Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 0D1E11337BD2 for ; Mon, 4 Apr 2011 16:35:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 47420-03 for ; Mon, 4 Apr 2011 19:35:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm2-vm0.bullet.mail.ukl.yahoo.com (nm2-vm0.bullet.mail.ukl.yahoo.com [217.146.183.226]) by mail.postgresql.org (Postfix) with SMTP id 2D9E81337BD1 for ; Mon, 4 Apr 2011 16:35:18 -0300 (ADT) Received: from [217.146.183.180] by nm2.bullet.mail.ukl.yahoo.com with NNFMP; 04 Apr 2011 19:35:18 -0000 Received: from [217.146.183.34] by tm11.bullet.mail.ukl.yahoo.com with NNFMP; 04 Apr 2011 19:35:18 -0000 Received: from [127.0.0.1] by omp1023.mail.ukl.yahoo.com with NNFMP; 04 Apr 2011 19:35:18 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 144585.28176.bm@omp1023.mail.ukl.yahoo.com Received: (qmail 77831 invoked by uid 60001); 4 Apr 2011 19:35:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1301945718; bh=tNGGkOLyjYfg3WChjOSjOcwBhuAqeQ4XgTMaYWoaB3o=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=UrDQLNORMTYoWWxOwYP8o6yO5cRhCdnXZnodX/AycMxWxDMonFMIKv3ERKLrRVw//khtnBcRYsKJQiRB7U3Pz352BdKu0I2QJ3wwc3TjISlDVK35rCUjF9EN4Asr9BwQ7z0H68IWF97b3jNGKErantqoLZm6e475n0NQ4OLIAv0= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Z2UzEBsZm5jthP4ylR3kA59bKkBfdoJAqOUhlAt7lw28k5QRdf/xuyh0wnhLVDu1QgApuMZ7wu7y2Iio8wr+KsFbB+vVGwMvzyeumSSrZuAMg3lxuZw10uGiFtdONKyXJy7OhJk1ntgGAPqgrsbNyNMtU9eg0vKJtDjpXg/vROA=; Message-ID: <33565.77565.qm@web26001.mail.ukl.yahoo.com> X-YMail-OSG: So4W2AkVM1myACEf0nFmY5sULvNZ0MZknAOboTs7hhiCQ.C _GWZ3W6IbGb0AdgpJ6UYKvKkXq1CPMx3kbBPreppkKdpZTi8vLyTwZoao7Ih cJp4jK6QGgtLjKm55jNBmfxnZglG9ePrdo_9orbzUI4fnjG0g0dgwK_ewUDn OqCMq5qJ922y6wxh19XA09V_iRWhoZ5Td2uobj6V95nV5CRO9v_CehOKRJmr 2EUMRl23VxFIpfFeZuG3G8Gx4FYL0N3Lt1ZJAZqYNsLaX.WmnjtuKt8gWDtq KiNUnL62QQlfE6F5zNiKAuAgt.hHH9uIxYeBqn0qApnTfLpD1imUdZ5tzkyZ LgRQEWQvn7IkBZgIscG42kS1cM5N_ Received: from [81.98.134.44] by web26001.mail.ukl.yahoo.com via HTTP; Mon, 04 Apr 2011 20:35:17 BST X-Mailer: YahooMailClassic/12.0.2 YahooMailWebService/0.8.109.295617 Date: Mon, 4 Apr 2011 20:35:17 +0100 (BST) From: Glyn Astill Subject: Re: Bloated indexes from pg_restore? (Was: Index fillfactor changed in pg9?) To: Tom Lane Cc: Kenneth Marshall , pgsql-admin@postgresql.org In-Reply-To: <1424.1301934766@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201104/41 X-Sequence-Number: 37222 =0A=0A--- On Mon, 4/4/11, Tom Lane wrote:=0A> > --- On = Mon, 4/4/11, Tom Lane =0A> wrote:=0A> >>> So it appears = now that if I restore the=0A> database using=0A> >>> pg_restore, I end up w= ith bloated indexes,=0A> which are fixed=0A> >>> with a vacuum full.=0A> >>= > =0A> >>> The dump is a data only dump with the -Fc=0A> flag,=0A> =0A> >> = Data only dump?=A0 Then what is the state of the=0A> >> database you're res= toring it into?=0A> =0A> > It's a newly created database from a schema only= =0A> dump.=0A> =0A> So the difference is that you have initially-empty inde= xes=0A> that are=0A> filled incrementally, whereas an ordinary dump-and-res= tore=0A> would be=0A> creating fresh indexes.=A0 Incremental filling of a= =0A> btree is usually said=0A> to result in about 66% fillfactor on average= , 50%=0A> worst-case; whereas by=0A> default I think we build fresh indexes= at 90%=0A> fillfactor.=A0 You didn't=0A> say how much "bloat" you were see= ing, but if it's less than=0A> 2X I think=0A> this is just expected.=A0 Unl= ess the data is pretty=0A> static, it's useless=0A> to hope that the fill f= actor will stay as high as 90%=0A> anyway.=0A> =0A=0AThanks Tom.=0A=0AYeah = that's exactly what I'm seeing, my indexes would be about 66% fillfactor.= =0A=0AI realize now, the reason I don't see this on our production machines= is because I drop and recreate the indexes & constraints either side of th= e data restore process. I'd not bothered with any of that for my tests, an= d assumed the difference was due to some sort of change in 9.0.=0A