mceachen/closure_tree — pull request #35 by elskwid (2012-12-31 00:54:20+00:00)
Title: WHERE ... IN / subselects

Extracted these from my spike last night.

Rework `self.leaves` and `#find_all_by_generation` to use `IN` with simple subselects instead of joining to them.

* These queries are more what we're trying to do in the methods - filter result sets.
* They provide performance improvements as the dataset grows in size.
* They are less likely to cause conflicts with other scopes on the data.