Re: MySQL 5.5.8 - Configuration Settings Suggestions
This construct scares me:
IN (1, NULL)
NULL is generally not treated as a "value" that can be compared.
You have a construct like this:
a AND b OR c
Please add parentheses. That is equivalent to
(a AND b) OR c
but I am worried that you meant
a AND (b OR c)
Please use [ code ] and [ /code ] without spaces around EXPLAIN output.
NOW() BETWEEN from AND to
is especially hard to optimize; INDEX(from, to) and INDEX(to, from) are not likely to help much, if any. (The EXPLAIN will say wither it is being used in the example you try.)
> it is reduced to 1966 from 2002
If that is "Rows", that does not say anything, since it is just an estimate.