Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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


pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group