| От | Tom Lane |
|---|---|
| Тема | Re: About index ... |
| Дата | |
| Msg-id | 22708.971275090@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | About index ... (<pejac@altern.org>) |
| Список | pgsql-novice |
<pejac@altern.org> writes:
> an doesn't work with select * from test where id < 45.
> EXPLAIN
> Seq scan on test
The system doesn't believe that WHERE clause is selective enough to be
efficiently done as an indexscan. An indexscan will be slower than a
seqscan unless it is able to visit just a small fraction of the rows
in the table, and a one-sided inequality doesn't guarantee that.
If 45 happens to be near the bottom of the range of ID values in this
table, then indeed an indexscan might be a reasonable implementation.
But the planner won't know the range of values unless you've done a
VACUUM ANALYZE on this table.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера