MySQL Forums
Forum List  »  Optimizer & Parser

Re: Force Table Selection Order in JOIN Statement?
Posted by: Toa Sty
Date: August 21, 2006 06:24AM

Not sure about the rest, but you can use:

SELECT STRAIGHT_JOIN blah blah...

to enforce join order.

Note that it's this one: http://dev.mysql.com/doc/refman/5.0/en/select.html
not this one: http://dev.mysql.com/doc/refman/5.0/en/join.html

I've been caught out in the past using this in some cases where my data distribution changed significantly over time.
The join order that made sense at the time of writing the query turned out to be horrendous a few months afterwards :}

HTH,
Toasty

Options: Reply• Quote


Subject
Views
Written By
Posted
Re: Force Table Selection Order in JOIN Statement?
9938
August 21, 2006 06:24AM


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.