List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:October 27 2001 12:31pm
Subject:Re: WHERE ... IN (...)
View as plain text  

>>>>> "Sinisa" == Sinisa Milivojevic <sinisa@stripped> writes:

Sinisa> On Sun, 21 Oct 2001 16:03:55 +0200
Sinisa> "André Næss" <andre@stripped> wrote:

Sinisa> Hi!

Sinisa> MySLQ is first sorting out a set, and then resolves one by one constant.

Sinisa> Furthermore, if any of the constants is out of the range for that column, it is
> skipped.

A small addition to this answer:

- MySQL is using a binary sort in the sorted list to check if the IN
  expression is true or false.
- If 'id' in 'WHERE id IN (1,2,4...)' is an index, then MySQL will do
  a key lookup for each of the values in the IN part to find the
  matching row.

WHERE ... IN (...)André Næss21 Oct
  • Re: WHERE ... IN (...)Sinisa Milivojevic22 Oct
    • Re: WHERE ... IN (...)Michael Widenius29 Oct