Re: Why does a simple query not use an obvious index?
В списке pgsql-performance по дате отправления:
| От | Steinar H. Gunderson |
|---|---|
| Тема | Re: Why does a simple query not use an obvious index? |
| Дата | |
| Msg-id | 20040830160228.GB16847@uio.no обсуждение |
| Ответ на | Re: Why does a simple query not use an obvious index? (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: Why does a simple query not use an obvious index?
|
| Список | pgsql-performance |
On Sun, Aug 29, 2004 at 06:03:43PM -0400, Tom Lane wrote: > The expression "now() - something" is not a constant, so the planner > is faced with "timestampfield > unknownvalue". Its default assumption > about the number of rows that will match is much too high to make an > indexscan look profitable (from memory, I think it guesses that about > a third of the table will match...). Out of curiosity, does the subselect query I presented earlier in the thread count as "a constant"? It gives the correct query plan, but this could of course just be correct by accident... /* Steinar */ -- Homepage: http://www.sesse.net/
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера