MySQL Forums
Forum List  »  Newbie

performance issue on order by index
Posted by: Ed Wong
Date: July 14, 2010 02:44AM

suppose i have a table with index on column "id" only

i have the following query:
select * from table where active=1 order by id desc limit 5

will this query loop through the whole table or just 5 rows?
please advice on performance issue.
will the order by "id" help in this case?

thx

ed



Edited 1 time(s). Last edit at 07/14/2010 02:45AM by Ed Wong.

Options: ReplyQuote


Subject
Written By
Posted
performance issue on order by index
July 14, 2010 02:44AM


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.