I think scaffolding will need to do range queries but not iterate over the whole set.  If it's iterating currently, it's probably filtering as well (to do a range query!)