MySQL Forums
Forum List  »  InnoDB

Are there any plans on improving count(*)'s speed?
Posted by: Manuel Aude
Date: January 19, 2009 03:48AM

I decided to give InnoDB a try, mainly because I care about integrity and being able to have true relations. Now, simple queries like:

SELECT u.id, u.username, y.difboards
FROM (
SELECT user_id, count( DISTINCT board_id ) AS difboards
FROM messages
GROUP BY user_id
ORDER BY difboards DESC
LIMIT 0 , 30
) AS y
inner join users u on u.id = y.user_id

That used to take 3 seconds (4.6 million rows in messages table) take a reaaaally long time. I had already denormalized the table for that query (3 seconds is too much for any user), but to avoid that kind of queries, I denormalized the DB even more, which shouldn't be necessary.

Why is it necessary to lack the speed of MyISAM for counts?

Options: ReplyQuote


Subject
Views
Written By
Posted
Are there any plans on improving count(*)'s speed?
3215
January 19, 2009 03:48AM


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.