Donny Simonton wrote:
> In our case we were using words, and phrases, so we would have something
> IN ('a', 'apple', 'apple car', 'car', 'c') etc...
> We found that once it hits about 200 or so entries the query went from 0.00
> seconds to about 2-3 seconds. Sometimes much more.
I would guess that it has more to do with the amount of your key
space that the list ranges over than with the absolute number of
entries. Try comparing "IN ('a', 'z')" (or something similar)
with "IN ('a', 'aa', 'aaa', 'aab', [...], 'aaaaaaaz')" (with
lots of entries, all between 'a' and 'ab', or another small
range). MySQL can use a range of the index for the second, even
though there are lots of entries, but not for the first, which
may force it to scan the whole index.
Keith Ivey <keith@stripped>