MySQL Forums
Forum List  »  Newbie

Re: Index not working as I expect
Posted by: Olek Marianski
Date: June 01, 2011 02:25PM

I figured out what's wrong - both phpmyadmin and myapp are adding Count() query to get no of results. Why mysql have to analyze all of the rows instead of checking the index on how much rows suits to query?

i.e.
SELECT COUNT(id) FROM table WHERE c1='c1' AND c2='c2' AND c3='c3' ORDER BY c4 DESC LIMIT 0,30;

rows analyzed - 30k.

Options: ReplyQuote


Subject
Written By
Posted
Re: Index not working as I expect
June 01, 2011 02:25PM


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.