Tomasz Rakowski wrote:
I have problem with frequently updated table (around 30.000 records and
1000 updates/minute, few indexes).
After a while all queries to that table become much slower then at the
begining
(the number of records in the table is quite stable all the time).
I can see that autovacuum is executed (select * from pg_stat_all_tables)
so it should update statistics and free unused space.
Sounds like autovacuum is running, but not often enough to keep up with
this highly active table. You may be able to get better results by
setting table specific autovacuum thresholds for this table so that it
get vacuumed more often. However if your table is *very* active then
autovacuum may not be able to keep up even with the more aggressive
settings, this is a known problem which is hopefully addressed in 8.3,
some people solve this by turning off autovacuum for the highly active
table and using a cron script to vacuum a table every minute or so.