pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
VACUUM/VACUUM FULL/REINDEX
2+ messages / 2 participants
[nested] [flat]

* VACUUM/VACUUM FULL/REINDEX
@ 2003-08-01 08:56  Sam Barnett-Cormack <s.barnett-cormack@lancaster.ac.uk>
  0 siblings, 1 reply; 2+ messages in thread

From: Sam Barnett-Cormack @ 2003-08-01 08:56 UTC (permalink / raw)
  To: pgsql-admin

I'm a little confused about comments I've seen on this list - a VACUUM
is not enough, clearly, to maintain a trim, efficient DB. People have
mentioned that REINDEX is also needed periodically. Is this the case
even if one VACUUM FULL's periodically, or does that effectively REINDEX
also?

-- 

Sam Barnett-Cormack
Software Developer                           |  Student of Physics & Maths
UK Mirror Service (http://www.mirror.ac.uk)  |  Lancaster University



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: VACUUM/VACUUM FULL/REINDEX
@ 2003-08-01 14:29  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Sam Barnett-Cormack <s.barnett-cormack@lancaster.ac.uk>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2003-08-01 14:29 UTC (permalink / raw)
  To: Sam Barnett-Cormack <s.barnett-cormack@lancaster.ac.uk>; +Cc: pgsql-admin

Sam Barnett-Cormack <s.barnett-cormack@lancaster.ac.uk> writes:
> I'm a little confused about comments I've seen on this list - a VACUUM
> is not enough, clearly, to maintain a trim, efficient DB. People have
> mentioned that REINDEX is also needed periodically.

If you have an index whose range of values continually shifts (for
example, a timestamp or serial-number column) then you will probably
need to REINDEX it every so often to reclaim empty space in the index.
This is at least partially fixed for 7.4, but it's necessary in all
prior versions.  The problem is that VACUUM had no mechanism to reclaim
btree pages that become totally empty because there's no longer any data
in the range of key values they represent.

When the indexed column's statistics aren't changing much over time,
I wouldn't think you'd need to do routine reindexing --- just keeping
after the table with VACUUM ought to be enough.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-08-01 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-08-01 08:56 VACUUM/VACUUM FULL/REINDEX Sam Barnett-Cormack <s.barnett-cormack@lancaster.ac.uk>
2003-08-01 14:29 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox