MySQL Forums
Forum List  »  Optimizer & Parser

Re: How could this SQL be optimized?
Posted by: Marion Gordon
Date: August 21, 2014 11:03PM

The SQL compiler constructs permutations of tables in the FROM clause of a query. The qualified inner join (x inner join y on p syntax) does not dictate a join order but the outer join syntax does. Otherwise join order is subject to change by the compiler's decision.

The first order tried by the optimizer is the initial left to right order of the FROM clause. The compiler remembers its best result so far attained in trying various compilations, so it will not explore branches of the table permutation tree which, while incomplete, exceed the cost of the best complete result so far. Thus a good guess of initial table order by the programmer may save compilation time.

Options: ReplyQuote


Subject
Views
Written By
Posted
2430
May 29, 2014 11:26PM
Re: How could this SQL be optimized?
1174
August 21, 2014 11:03PM


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.