List:General Discussion« Previous MessageNext Message »
From:Morten Primdahl Date:July 21 2009 5:42pm
Subject:Re: Index selection problem
View as plain text  
On Jul 21, 2009, at 3:27 PM, Johnny Withers wrote:

> MySQL is unable to use your index when you use IN and/or OR on yoru  
> column.

Is this really true?

I'm reading "High Performance MySQL 2nd ed." these days and  
specifically got the impression that using IN will allow usage of the  
index. The below quote is from the book, and the "multiple equality  
condition" refers to an IN (...) expression.

"... we draw a distinction between ranges of values and multiple  
equality conditions.The second query is a multiple equality condition,  
in our terminology. We’re not just being picky: these two kinds of  
index accesses perform differently. The range condition makes MySQL  
ignore any further columns in the index, but the multiple equality  
condition doesn’t have that limitation."

Index selection problemMorten21 Jul
  • Re: Index selection problemJohnny Withers21 Jul
    • Re: Index selection problemMorten Primdahl21 Jul
      • Re: Index selection problemJohn Daisley21 Jul
        • Re: Index selection problemJohnny Withers23 Jul
  • Re: Index selection problemBrent Baisley21 Jul
    • Re: Index selection problemMorten Primdahl21 Jul