List:General Discussion« Previous MessageNext Message »
From:Jeremy Cole Date:September 14 2007 8:33am
Subject:Re: excessive time spent in "statistics" status
View as plain text  
Hi Shawn, Lucio,

> SELECT STRAIGHT_JOIN ....
> FROM ...
> LEFT JOIN ...
> WHERE ...
> ...

Just to correct a point here... if a query uses only LEFT JOIN or RIGHT 
JOIN, the join order is fixed by the query's order itself, so using 
STRAIGHT_JOIN should have no effect whatsoever.  Equally important, 
since the join order is fixed when you use LEFT JOIN, you *must* list 
the joins in the correct order when writing the query, otherwise you 
will see very poor performance.

MySQL's optimizer cannot reorder the joins because it has the potential 
to change the result of the query.

Regards,

Jeremy

-- 
high performance mysql consulting
www.provenscaling.com
Thread
excessive time spent in "statistics" statusLucio Chiappetti31 Aug
  • Re: excessive time spent in "statistics" statusShawn Green1 Sep
    • Re: excessive time spent in "statistics" statusLucio Chiappetti3 Sep
      • Re: excessive time spent in "statistics" statusShawn Green3 Sep
        • Re: excessive time spent in "statistics" statusLucio Chiappetti4 Sep
          • Re: excessive time spent in "statistics" statusLucio Chiappetti4 Sep
            • Re: excessive time spent in "statistics" statusShawn Green4 Sep
              • Re: excessive time spent in "statistics" statusLucio Chiappetti5 Sep
        • Re: excessive time spent in "statistics" statusJeremy Cole14 Sep
          • Re: excessive time spent in "statistics" statusLucio Chiappetti14 Sep
          • Re: excessive time spent in "statistics" statusPete Harlan17 Sep
            • Re: excessive time spent in "statistics" statusBaron Schwartz17 Sep