MySQL Forums :: Newbie :: performance issue on order by index


Advanced Search

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 Ed Wong 07/14/2010 02:44AM
Re: performance issue on order by index Devart Team 07/14/2010 03:35AM
Re: performance issue on order by index Rick James 07/14/2010 11:27PM
Re: performance issue on order by index sandeepji ji 07/15/2010 02:32AM


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.