Followup fix for 352f4ea: ORM count_all speedup