MySQL Forums
Forum List  »  Performance

Which strategy is better to traverse a big table?
Posted by: yanlin peng
Date: February 23, 2009 01:58AM

I am asking kind suggestions on how to go through a big (>10 million rows) table.
The database type is MYISAM. The table has a PRIMARY KEY on a AUTO_INCREMENT column and an index on (feedback_time, feedback_id, feedback_user).
I want to go through the whole table in the order of feedback_time, feedback_id, feedback_user from my c program.

I am a newbie. So I have this maybe silly question: should I get the whole table at once or chunk by chunk?
Precisely, should I do:
SELECT * FROM feedback ORDER BY feedback_time, feedback_id, feedback_user.
or:
SELECT * FROM feedback ORDER BY feedback_time, feedback_id, feedback_user LIMIT offset, rows
Which way is faster to go through a big table?

Thanks!

Options: ReplyQuote


Subject
Views
Written By
Posted
Which strategy is better to traverse a big table?
4495
February 23, 2009 01:58AM


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.