MySQL Forums
Forum List  »  Performance

Count massively faster than select on same query, why?!?!
Posted by: John
Date: August 03, 2006 09:32AM

Hi,

ANy idea why a

"Select Count(*) ...query..."

would take 3 seconds and the exact same query with a

"Select column1 ....query..."

would take 20 times longer?

Surely the Select Count(*) has to find the rows before the count, so its doing much the same amount of work?

the example I have returns 3 rows out of 400k rows. Not a big ask.

MySql 4.1.19 on Linux, myisam tables, Nothing unusual about the setup

Any comments or pointers much appreciated. Thank you!!!

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.