MySQL Forums
Forum List  »  Optimizer & Parser

Re: Optimizing query
Posted by: Jørgen Løland
Date: May 24, 2011 12:49AM

Hi jr wakabayashi,

There are many complicating factors with this query. I'll give you a hint to start with:

There are two RIGHT JOINs. RIGHT and LEFT JOINs are much harder to run in an optimal way than inner joins. The reason is that MySQL has to put the outer table first in the join order. Depending on the database schema and amount of data in the tables, this can lead to significantly lower performance.

Please provide the output of these commands so I'm able to tell you more:

* EXPLAIN for the query
* SHOW CREATE TABLE for all the involved tables

Also, please enclose the output in [code ] [/code ] (remove the space) tags for readability.

Hope this helps,
Jørgen Løland
Software Engineer, MySQL, Oracle
jorgenloland.blogspot.com

Options: ReplyQuote


Subject
Views
Written By
Posted
3425
May 23, 2011 04:12PM
Re: Optimizing query
1097
May 24, 2011 12:49AM
1087
May 27, 2011 08:55AM
1086
May 28, 2011 12:30AM
1102
May 28, 2011 10:40PM
1048
May 29, 2011 12:54PM


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.