[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] Index bloat of 4x
From:       Bruce Momjian <bruce () momjian ! us>
Date:       2007-01-31 4:15:55
Message-ID: 200701310415.l0V4FtP19125 () momjian ! us
[Download RAW message or body]

Tom Lane wrote:
> Bill Moran <wmoran@collaborativefusion.com> writes:
> > The entire database was around 28M prior to the upgrades, etc.  Immediately
> > after the upgrades, it was ~270M.  Following a vacuum full, it dropped to
> > 165M.  Following a database-wide reindex, it dropped to 30M.
> 
> As Alvaro said, vacuum full doesn't shrink indexes but in fact bloats them.
> (Worst case, they could double in size, if the vacuum moves every row;
> there's an intermediate state where there have to be index entries for
> both old and new copies of each moved row, to ensure things are
> consistent if the vacuum crashes right there.)
> 
> So the above doesn't sound too unlikely.  Perhaps we should recommend
> vac full + reindex as standard cleanup procedure.  Longer term, maybe
> teach vac full to do an automatic reindex if it's moved more than X% of
> the rows.  Or forget the current vac full implementation entirely, and
> go over to something acting more like CLUSTER ...

TODO already has:

	* Improve speed with indexes
	
	  For large table adjustments during VACUUM FULL, it is faster to
	  reindex rather than update the index.  Also, index updates can
	  bloat the index.

-- 
  Bruce Momjian   bruce@momjian.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic