Re: is this a bug or do I not understand the query planner?
В списке pgsql-bugs по дате отправления:
| От | Peter Eisentraut |
|---|---|
| Тема | Re: is this a bug or do I not understand the query planner? |
| Дата | |
| Msg-id | 200511040059.27965.peter_e@gmx.net обсуждение исходный текст |
| Ответ на | is this a bug or do I not understand the query planner? (Rob Prowel <tempest766@yahoo.com>) |
| Список | pgsql-bugs |
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/
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера