pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: scott.marlowe <scott.marlowe@ihs.com>
Cc: Jeff Boes <jboes@qtm.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: Disk Utilization Increases And Time for Vacuum Increases.
Date: Tue, 26 Aug 2003 23:00:03 -0400 (EDT)
Message-ID: <200308270300.h7R303H22974@candle.pha.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.33.0308251313400.29716-100000@css120.ihs.com>

scott.marlowe wrote:
> On Mon, 25 Aug 2003, Jeff Boes wrote:
> 
> > >One action we have consiously not done is "REINDEX" on the
> > >table. We want to avoid that as far as possible.
> > 
> > Why? It's usually a very painless step, unless the table has millions and
> > millions of rows. We reindex tables with multiple indexes and several million
> > rows on a weekly basis. The only downside is that the table seems to be quite
> > "busy" during the process, which only takes a few minutes.
> > 
> > AFAIK, VACUUM doesn't reclaim space taken up by indexes. In fact, the more
> > deletes you do, the larger the index space gets, and the *slower* the index
> > performs. A periodic REINDEX cleans up a lot of problems.
> 
> Note that in 7.4 the fix for this is in, so if you have a chance to test 
> it out with your indexes and their growth problem please test it to see if 
> it works right.
> 
> I haven't tested 7.4 beta1 yet very hard, just on my workstation, with 
> relatively low level stuff.

I am not sure we have completely dealt with index growth in 7.4.  What
we have new in 7.4 is the ability for non-FULL VACUUM to collect info on
free index pages and reuse them.

However, VACUUM FULL does not shrink the index table unless those pages
are the last pages of the file.  (Could it shift free pages to the end
and then truncate index?)  Also, does VACUUM FULL on an index put the
empty index pages in the FSM map?  It doesn't do that for heap pages
because there are none after vacuum, but there might be free index pages
that we should record.

Interesting I found a reference of doing an auto-reindex as part of
VACUUM FULL:
	
	#ifdef NOT_USED
	
	    /*
	     * reindex in VACUUM is dangerous under WAL. ifdef out until it
	     * becomes safe.
	     */
	    if (reindex)
	    {
	        vac_close_indexes(nindexes, Irel);
	        Irel = (Relation *) NULL;
	        activate_indexes_of_a_table(onerel, false);
	    }
	#endif   /* NOT_USED */


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



view thread (13+ messages)  latest in thread

Message-ID: <200308270300.h7R303H22974@candle.pha.pa.us>
Permalink:  ../200308270300.h7R303H22974@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200308270300.h7R303H22974@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: pgman@candle.pha.pa.us, scott.marlowe@ihs.com, jboes@qtm.net
  Subject: Re: Disk Utilization Increases And Time for Vacuum Increases.
  In-Reply-To: <200308270300.h7R303H22974@candle.pha.pa.us>
  References: <Pine.LNX.4.33.0308251313400.29716-100000@css120.ihs.com> <200308270300.h7R303H22974@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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