Re: REINDEX : new parameter to preserve current average leaf densityas new implicit FILLFACTOR - Mailing list pgsql-general

From Peter Geoghegan
Subject Re: REINDEX : new parameter to preserve current average leaf densityas new implicit FILLFACTOR
Date
Msg-id CAH2-WzmqKkT01cw51HXd75WJvAvQw3c8rn_oTWqAFBbwFQrP4A@mail.gmail.com
Whole thread Raw
In response to Re: REINDEX : new parameter to preserve current average leaf density as new implicit FILLFACTOR  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Tue, Jun 25, 2019 at 2:56 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > This would avoid the saw-tooth effect on number of pages,   and also reduce the number of index page-splits which
occurduring the period immediately following a REINDEX done with default FILLFACTOR of 90%.   In effect,  it lessens
theneed for the physical reorganization aspect of REINDEX and focusses more on the function of removing dead  keys. 
>
> I think you've confused REINDEX with VACUUM.  It seems like a pretty poor
> substitute for that --- it's much more expensive and has worse locking
> requirements.

There is a very recent research paper that discusses the idea of
varying fillfactor with a view to ameliorating page splits:

https://btw.informatik.uni-rostock.de/download/tagungsband/B2-2.pdf

I found the paper to be fairly convincing. The general idea is to make
page splits occur at a steady rate following a REINDEX, rather than
having "waves" of page splits. This is quite different to changing
leaf fillfactor based on the observed leaf density, though. You can
already do that by looking at pgstattuple's pgstatindex() function,
which reports a avg_leaf_density for the index. Though I agree that
that's not likely to help matters. Apart from anything else, the
steady state of an index is embodied by more than just its
avg_leaf_density. Especially following the v12 enhancements to B-Tree
indexes.

--
Peter Geoghegan



pgsql-general by date:

Previous
From: David Gauthier
Date:
Subject: Need a referential constraint to a non-unique record
Next
From: Peter Geoghegan
Date:
Subject: Re: REINDEX : new parameter to preserve current average leaf densityas new implicit FILLFACTOR