Re: I don't understand this explain output

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: PostgreSQL List - Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: I don't understand this explain output
Date: 2009-05-26 12:59:49
Message-ID: 4A1BE7C5.1040508@sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ron Arts 2009-05-26 13:12:24 Re: I don't understand this explain output
Previous Message Ognjen Blagojevic 2009-05-26 11:25:00 Re: Tool for modeling