On 5/23/06, Anish Enos Mathew <[EMAIL PROTECTED]> wrote:
Hi Michael, I am retrieving records from the data base randomly. I want to perform 1,000,000 retrieval of 1,000,000 random records from the data base. When I am retrieving 15 bytes records from the data base, it works fine. It just takes around 20 seconds for 1,000,000 retrievals. But when I am trying to retrieve 1k records, it's taking too long a time. Around 100 sec for just 50,000 retrievals. Also I am not querying the data using ROWID. I want to reduce the retrieval time without increasing the memory of the system. How to do that. As you told me in the previous mail, there must be lot of IO calls since the whole database doesn't fit into memory. Is there any way out to solve this problem ???
Add a new numeric column to the table (lets call it "X"). Set column X to a random number for every row. Create an index on column X. Then you can use this sql to retrieve the records: select * from mytable order by X limit 1000000