Improve record prefetching performance

1. Do not prefetch too many records at once: fix an arbitrary limit to avoid filling up the cache like crazy.
2. Prefetch all fields with groups to which the user has access.