Skip navigation links

MySQL Forums :: Optimizer & Parser :: Explain the order of query


Advanced Search

Re: Explain the order of query
Posted by: Jørgen Løland ()
Date: March 28, 2012 05:06AM

Hi Jongse,

From the information you have provided it's not possible to say in which order these tables are accessed/subqueries executed. The only thing that is certain is that T1 is accessed before T2 because of the relative order within the query block (i.e., same id=1).

Depending on the query, query blocks 2, 3 and 4 may be executed before T2 is joined with T1. Thus, not only "1-1-2-3-4" and "1-1-4-2-3" is possible, but maybe even "1-2-3-4-1" and all similar permutations.

I believe you have these choices at the moment:
* provide the information Rick has requested (SHOW CREATE TABLE, the query etc)
and thus give us an opportunity to answer
* download MySQL 5.6 and use optimizer tracing to see the actual execution order
* get a support deal and provide them with the info you have
* accept that you won't get an answer to this :-(

For optimizer tracing, see here

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

Options: ReplyQuote


Subject Views Written By Posted
Explain the order of query 1175 jongse park 03/19/2012 01:49AM
Re: Explain the order of query 551 Rick James 03/19/2012 10:38PM
Re: Explain the order of query 572 jongse park 03/21/2012 07:06PM
Re: Explain the order of query 482 Rick James 03/22/2012 06:01PM
Re: Explain the order of query 474 jongse park 03/22/2012 08:13PM
Re: Explain the order of query 479 Rick James 03/23/2012 07:57PM
Re: Explain the order of query 659 Jørgen Løland 03/28/2012 05:06AM


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.