pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Glyn Astill <glynastill@yahoo.co.uk>
Cc: Kenneth Marshall <ktm@rice.edu>
Cc: pgsql-admin@postgresql.org
Subject: Re: Bloated indexes from pg_restore? (Was: Index fillfactor changed in pg9?)
Date: Mon, 04 Apr 2011 12:32:46 -0400
Message-ID: <1424.1301934766@sss.pgh.pa.us> (raw)
In-Reply-To: <736208.74368.qm@web26007.mail.ukl.yahoo.com>
References: <736208.74368.qm@web26007.mail.ukl.yahoo.com>

Glyn Astill <glynastill@yahoo.co.uk> writes:
> --- On Mon, 4/4/11, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> So it appears now that if I restore the database using
>>> pg_restore, I end up with bloated indexes, which are fixed
>>> with a vacuum full.
>>> 
>>> The dump is a data only dump with the -Fc flag,

>> Data only dump?  Then what is the state of the
>> database you're restoring it into?

> It's a newly created database from a schema only dump.

So the difference is that you have initially-empty indexes that are
filled incrementally, whereas an ordinary dump-and-restore would be
creating fresh indexes.  Incremental filling of a btree is usually said
to result in about 66% fillfactor on average, 50% worst-case; whereas by
default I think we build fresh indexes at 90% fillfactor.  You didn't
say how much "bloat" you were seeing, but if it's less than 2X I think
this is just expected.  Unless the data is pretty static, it's useless
to hope that the fill factor will stay as high as 90% anyway.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <1424.1301934766@sss.pgh.pa.us>
Permalink:  ../1424.1301934766@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1424.1301934766@sss.pgh.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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, glynastill@yahoo.co.uk, ktm@rice.edu
  Subject: Re: Bloated indexes from pg_restore? (Was: Index fillfactor changed in pg9?)
  In-Reply-To: <1424.1301934766@sss.pgh.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