MySQL Forums
Forum List  »  Optimizer & Parser

Re: Help with optimizing GROUP BY query
Posted by: KimSeong Loh
Date: June 12, 2006 08:37AM

Depends the selectivity of this UserQuiz.quizId=1 , it may use the index quizId.

Maybe the index (quizId,userId), it may be able to reduce the sorting in GROUP BY, however a filesort (or sorting) is still required in the ORDER BY.
It needs to do the Group for all rows that satisfy UserQuiz.quizId=1 before it can get you the 10 best scores.

Options: Reply• Quote


Subject
Views
Written By
Posted
5514
June 12, 2006 07:16AM
Re: Help with optimizing GROUP BY query
2786
June 12, 2006 08:37AM
2680
June 12, 2006 10:54AM


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.