| От | Tom Lane |
|---|---|
| Тема | Re: Yet another "Why won't PostgreSQL use my index?" |
| Дата | |
| Msg-id | 12800.1024592083@sss.pgh.pa.us обсуждение |
| Ответ на | Yet another "Why won't PostgreSQL use my index?" ("Gregory Wood" <gregw@com-stock.com>) |
| Список | pgsql-general |
"Gregory Wood" <gregw@com-stock.com> writes:
> Trying to use a single column index on a somewhat large table (1.9M rows),
> and PostgreSQL really doesn't want to. It estimates the number of rows at
> 12749 (actual 354), which is only .6% of the table... well within reasonable
> index range I would think. And yes, I've run an analyze on the table.
Could we see the analyze results --- ie, the pg_stats row for the
idx_siteid column?
Increasing the statistics target for that column might help, but I'm
interested to see what it thinks the distribution is right now. The
problem AFAICT is the factor-of-36 overestimation of the number of
matching rows; had that estimate been even within a factor of 20 of
correct, the correct plan would have been chosen.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера