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
--
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance