MySQL Forums
Forum List  »  Performance

Re: Count massively faster than select on same query, why?!?!
Posted by: John
Date: August 03, 2006 01:12PM

Thanks for your reply Bob.

Not sure I explained it correctly.

Query 1) select count(*) from xyz where colum1="abc", column2="def" and "column4="ghi";

takes 3 seconds.


Query 1) select * from xyz where colum1="abc", column2="def" and "column4="ghi";

takes 60 seconds.

All I can see is that they both have to find the same rows, query1 then just counts then, query2 doesnt have to do much more tho? why the big difference? How can maintain a row count help in this query when the count depends on the conditions?

Options: ReplyQuote




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.