Query caching via subset matching

Lafcadio caches every query, and optimizes based on a simple subset calculation. For example, if you run these statements:

User.get { |u| u.lname.equals( 'Smith' ) }
User.get { |u| u.lname.equals( 'Smith' ) & u.fname.like( /John/ ) }
User.get { |u| u.lname.equals( 'Smith' ) & u.email.like( /hotmail/ ) }

Lafcadio can tell that the 2nd and 3rd queries are subsets of the first. So these three statements will result in one database call, for the first statement: The 2nd and 3rd statements will be handled entirely in Ruby. The result is less database calls with no extra work for the programmer.