Query optimization, strange things are afoot in the active record