MySQL Forums
Forum List  »  Optimizer & Parser

Optimize a query fetching huge data
Posted by: Radhika Mehta
Date: April 16, 2008 01:21AM

Hi! I have around 2 million data in a particular table. Through my web applications, I want to show it as a report. I intend to show it page-wise. So my first page will have around 20 records, next page will have the next 20 records and so on. I am using a query in oracle :

select * from ( select a.*, rownum r from (select * from tablename) a where rownum < 100 ) where r > 89;

Can u please tell me an optimized query correspondingly in mysql?

The best option I could think of was:
select * from tablename limit 1,10;
select * from tablename limit 10,10; and so on

Is there any other optimized way in which I can get my result faster???

Regards,
Radhika

Options: ReplyQuote


Subject
Views
Written By
Posted
Optimize a query fetching huge data
6155
April 16, 2008 01:21AM
2953
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.