|
Hi Don,
Here is the query plan: mysql> explain select localmembe0_.groupid as groupid__, localmembe0_.userid as userid__, defaulthib1_.id as id0_, defaulthib1_.name as name0_, defaulthib1_.password as password0_, defaulthib1_.email as email0_, defaulthib1_.created as created0_, defaulthib1_.fullname as fullname0_ from local_members localmembe0_ inner join users defaulthib1_ on localmembe0_.userid=defaulthib1_.id where localmembe0_.groupid=13205505; +----+-------------+--------------+--------+----------------------------+---------+---------+---------------------------+-------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+--------------+--------+----------------------------+---------+---------+---------------------------+-------+-------------+ | 1 | SIMPLE | localmembe0_ | ref | PRIMARY,FK6B8FB445CE2B3226 | PRIMARY | 8 | const | 22686 | Using index | | 1 | SIMPLE | defaulthib1_ | eq_ref | PRIMARY | PRIMARY | 8 | wikis.localmembe0_.userid | 1 | | +----+-------------+--------------+--------+----------------------------+---------+---------+---------------------------+-------+-------------+ I think that we are facing several issues here, combination of which causes our db to perform terribly. Issues we know about are: cheers, CONF-10030 is definitely a problem, but that query plan shows that this query should run very fast. I suspect the mysql people will be able to help you with your mysql configuration to avoid your thread thrashing problems.
Now that you've addressed CONF-10030 in your instance are you still having problems with the groups query? wikis.sun.com has been stable since the patch for CONF-10030 was applied, but I still consider addMembership to be an issue waiting to bite us at any time. Especially as the number of registered users grow rapidly.
Running the query above currently takes quite some time: 25437 rows in set (13.57 sec) Other than this query, the db is screaming fast at the moment. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Thanks for raising this issue.
While obviously I agree that's a very inefficient way to perform the operation, I'm also surprised that such a query would take several minutes, even with 25000 users in the group.
Are you missing an index on either local_members.groupid or users.id?
What does MySQL say if you ask it to EXPLAIN the actual query that runs?
Cheers,
Don