Re: optimizing Postgres queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: optimizing Postgres queries
Дата
Msg-id 20540.1073329548@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: optimizing Postgres queries  (David Teran <david.teran@cluster9.com>)
Ответы Re: optimizing Postgres queries
Список pgsql-performance
David Teran <david.teran@cluster9.com> writes:
> explain result from second query:

> Seq Scan on "KEY_VALUE_META_DATA" t0  (cost=0.00..2671.16 rows=931 width
> =1068) (actual time=122.669..172.179 rows=25 loops=1)
>   Filter: (("ID_VALUE" = 21094) OR ("ID_VALUE" = 21103))

The problem is evidently that the row estimate is so far off (931
estimate vs 25 actual).  Have you done ANALYZE or VACUUM ANALYZE
on this table recently?  If you have, I'd be interested to see the
pg_stats row for ID_VALUE.  It might be that you need to increase
the statistics target for this table.

            regards, tom lane

В списке pgsql-performance по дате отправления:

Предыдущее
От: John Siracusa
Дата:
Сообщение: Select max(foo) and select count(*) optimization
Следующее
От: David Teran
Дата:
Сообщение: Re: optimizing Postgres queries