MySQL Forums
Forum List  »  Newbie

Re: EXPLAIN on SELECT is confusing me
Posted by: Peter Brawley
Date: March 17, 2009 08:29AM

What's killing that query is Using temporary; Using filesort on 243425 rows. From the manual page on GROUP BY optimisation:

"The most important preconditions for using indexes for GROUP BY are that all GROUP BY columns reference attributes from the same index, and that the index stores its keys in order (for example, this is a BTREE index and not a HASH index). Whether use of temporary tables can be replaced by index access also depends on which parts of an index are used in a query, the conditions specified for these parts, and the selected aggregate functions."

See the following sections for more info.

PB
http://www.artfulsoftware.com

Options: ReplyQuote


Subject
Written By
Posted
Re: EXPLAIN on SELECT is confusing me
March 17, 2009 08:29AM


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.