Make latest/latest-for more efficient

Getting all matching rows from the database is expensive.

Created by  Eelco Dolstra  on May 23, 2013
XG3QG5ICOI5HGJY4T3M7PDIXTJ5HCV6FTRI5XBY5ZD5SPAZ2CCFQC
Change contents