>If I want to select N top records, does VFP still create a whole resultset in memory?
Before VFP9, yes. In VFP9, it depends. From VFP9 help:
"In Visual FoxPro 9.0, performance has been improved by eliminating records that do not qualify for the TOP N from the sort process as early as possible.
The TOP N optimization is done only if the SET ENGINEBEHAVIOR Command is set to 90".
--sb--