Web lists-archives.com

store search result as new table in memory

hello Masters,
I am a novice, and I am wanting to know how to achieve this:
1million plus row in a table.
user runs a search, gets some results. I want to store this result in memory in a way, so that user can fire more SQL searches on this result. How is this done? I want this to go atleast upto 20 levels down.
in addition, lets say when I am 4th level down, can I have the previous levels intact for making fresh searches on them?
I also want to store some queries, which produce level X result, in a manner that it speeds the process in future (user do not have to make multiple searches to get to the result)

initial Table||---1st search run on initial table (level 1)      |      |-----2nd search run on previously obtained result rows (level 2)

any help is highly appreciated.
thank you.