Re: Slow Delete : Seq scan instead of index scan

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Slow Delete : Seq scan instead of index scan
Дата
Msg-id 507E4E05.9040400@ringerc.id.au
обсуждение исходный текст
Ответ на Re: Slow Delete : Seq scan instead of index scan  (Filippos Kalamidas <filippos.kal@gmail.com>)
Список pgsql-performance
On 10/16/2012 04:41 PM, Filippos Kalamidas wrote:
> the first thing you should probably do is run an 'analyze' on one of
> these tables and then run again the delete statement. if there are no
> stats for these tables, it's normal not to have very good plans.

Yep, and the fact that the stats are that bad suggests that autovaccum
probably isn't running, or isn't running often enough.

If you have a high INSERT/UPDATE/DELETE load, then turn autovacuum up on
that table. See:

   http://www.postgresql.org/docs/current/static/routine-vacuuming.html


http://www.postgresql.org/docs/current/static/runtime-config-autovacuum.html


If the table is badly bloated it might be worth running "VACUUM FULL" on
it or (if you're on PostgreSQL 8.4 or below) instead CLUSTER the table
on an index, as "VACUUM FULL" is very inefficient in 8.4 and older (I
think; I might be misremembering the versions).


Please specify your PostgreSQL version in all questions. See
https://wiki.postgresql.org/wiki/Slow_Query_Questions

--
Craig Ringer



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

Предыдущее
От: "Sam Wong"
Дата:
Сообщение: Re: LIKE op with B-Tree Index?
Следующее
От: Yetkin Öztürk
Дата:
Сообщение: pgbounce max_client_conn and default_pool_size