in reply to Extracting Numerous records
I would set up the application / web page so that the first time, it merely sends the query. After that, it asks for the query and record # N.
That way you don't have to store status for users or interactions, don't have to clean up expired stuff. And does it matter if a query comes 5 minutes and 1 second after a previous one? Or if someone asks for record #2, without ever getting record #1?
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
In Section
Seekers of Perl Wisdom