List:General Discussion« Previous MessageNext Message »
From:Morgan Tocker Date:March 19 2014 4:12pm
Subject:Re: Precedence in WHERE clauses.
View as plain text  
Hi Harald,

> you can call me Harald

My apologies!

> the question was "is there any performance impact"
> and (DWProcessed / Lowest cardinality and indexed)
> 
> so *yes* it does matter, i have seen MySQL more than once not using any
> index because a unlucky order of where clauses up to copy a 16 GB
> table in a table file instead using a existing primary key

If you have experienced that the order of the where clause has changed which execution
plans are possible, I suggest taking a look at optimizer trace:
http://dev.mysql.com/doc/internals/en/optimizer-tracing.html

This is more detailed than EXPLAIN and will show indexes being considered, and the reasons
that they are excluded.

The 1=1 example I gave will also show as eliminated in optimizer trace.

- Morgan
Thread
Precedence in WHERE clauses.Christophe18 Mar 2014
  • Re: Precedence in WHERE clauses.Michael Dykman18 Mar 2014
    • Re: Precedence in WHERE clauses.Christophe20 Mar 2014
      • Re: Precedence in WHERE clauses.Roy Lyseng20 Mar 2014
  • Re: Precedence in WHERE clauses.Glyn Astill19 Mar 2014
  • Re: Precedence in WHERE clauses.Morgan Tocker19 Mar 2014
    • Re: Precedence in WHERE clauses.Reindl Harald19 Mar 2014
      • Re: Precedence in WHERE clauses.Morgan Tocker19 Mar 2014
        • Re: Precedence in WHERE clauses.Reindl Harald19 Mar 2014
          • Re: Precedence in WHERE clauses.Morgan Tocker19 Mar 2014
            • Re: Precedence in WHERE clauses.Christophe20 Mar 2014
              • Re: Precedence in WHERE clauses.Christophe23 Mar 2014
                • Re: Precedence in WHERE clauses.shawn l.green25 Mar 2014
    • Re: Precedence in WHERE clauses.Mogens Melander19 Mar 2014
      • Re: Precedence in WHERE clauses.shawn l.green20 Mar 2014