Rob Prowel wrote:
> two almost identical queries: one searches for
> read in ('N','n')
> and the other searches for
> read in ('Y','y').
>
> the (explain) SQL statement says that one uses the
> index on the (read) field and the other does a
> sequential table scan. Why!!!???? I can think of no
> logical reason for this behavior.
Imagine a table with one million 'Y' and one 'N'. Searching for the
first should not use an index, searching for the second should. A
similar case probably applies here. I hope that is logical enough for
you. :)
In general, if you disagree with a plan choice, you should provide
evidence that the chosen plan is in practice worse then the one you
would have preferred.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/