Re: Optimize a query fetching huge data
Posted by:
Rick James
Date: September 01, 2008 12:02AM
One problem with the nifty LIMIT is that it get slower and slower as you go thru the pages. If you have some kind of sequence number (eg auto_increment) in the table, and if it is in the right order for the pagination, then use it thus:
* When building one page, remember where you "left off" via that sequence number.
* For the "Next" page, use ... WHERE id > $left_off ORDER BY id LIMIT 10.
Do you really want to page thru 100K pages?
Subject
Views
Written By
Posted
6158
April 16, 2008 01:21AM
2814
July 22, 2008 03:33AM
Re: Optimize a query fetching huge data
2954
September 01, 2008 12:02AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.