collectiveidea/awesome_nested_set — pull request #122 by marktorrance (2012-03-16 04:52:53+00:00)
Title: Improve performance of self_and_descendants

This modified version of self_and_descendants is semantically equivalent and passes all tests, but it uses only the lft field of the records it queries, which means it can benefit from an index on that field if one exists on your table.