| От | Tom Lane |
|---|---|
| Тема | Re: Strange (?) Index behavior? |
| Дата | |
| Msg-id | 12855.1099688936@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Strange (?) Index behavior? (Allen Landsidel <alandsidel@gmail.com>) |
| Список | pgsql-performance |
Allen Landsidel <alandsidel@gmail.com> writes:
> With seqscan enabled however, "AB%" will use the index, but "A%" will not.
> The estimated cost for the query is much higher without the partial
> indexes than it is with them, and the actual runtime of the query is
> definitely longer without the partial indexes.
OK. This suggests that the planner is drastically misestimating
the selectivity of the 'A%' clause, which seems odd to me since in
principle it could get that fairly well from the ANALYZE histogram.
But it could well be that you need to increase the resolution of the
histogram --- see ALTER TABLE SET STATISTICS.
Did you ever show us EXPLAIN ANALYZE results for this query?
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера