MySQL Forums
Forum List  »  Performance

Re: Slow query when joining 2 very large tables with Group and Order
Posted by: Øystein Grøvlen
Date: June 24, 2014 02:28AM

Hi,

I was not thinking about the temporary table used for grouping/ordering. There is no way to avoid temporary table if grouping and ordering are on different columns.

I was thinking of the temporary table you get when you have a sub-query in the FROM clause.

Alternatives you could try:

1. Force a different JOIN order with STRAIGHT_JOIN. That is,
... FROM tbl_profile STRAIGHT_JOIN tbl_profile_interest_map map ...


2. Upgrade to MySQL 5.6 which may use Index Condition Pushdown to reduce number
of accesses from index to the table.

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Slow query when joining 2 very large tables with Group and Order
885
June 24, 2014 02:28AM


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.