Ron Arts wrote:
> m=# explain select * from queue;
> QUERY PLAN
> ------------------------------------------------------------
> Seq Scan on queue (cost=0.00..635477.00 rows=1 width=402)
> (1 row)
>
> The cost seems to be very high. It's a small table (only 23 rows)
> and has not seen many modifications since the table was initially
> filled. OTOH many individual records are updated every minute.
Then the inidividual records have been updated 635,477 times; because
that's how many rows are really in the table. Each time a record is
updated, the old one is still in database and a new one is added. Run
"VACUUM FULL ANALYSE" on a regular basis to remove the obsolete records
from table and recover disk space.
Since 8.1, there is an optional feature called autovacuum.