MySQL Forums
Forum List  »  Performance

Re: Which strategy is better to traverse a big table?
Posted by: Rick James
Date: February 24, 2009 11:29AM

Selecting lots of rows --
If the C API delivers all the rows at once, you may run out of RAM.
If it delivers them piecemeal, then you are good to go.
See what the API does, and whether it can be prodded to do things piecemeal.

LIMIT M,N will be costly, as aftab explained.

If you need to chunk something, it is best to "remember where you left off" and then do
SELECT ... WHERE id > $left_off LIMIT 100;
However, it gets more complicated since you don't have a single key for traversing, and probably feedback_time is not unique. (The 100 could land in the middle of several rows with the same feedback_time; then how to you pick up where you left off.)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Which strategy is better to traverse a big table?
1847
February 24, 2009 11:29AM


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.