TODO-Item: B-tree fillfactor control - Mailing list pgsql-hackers

From ITAGAKI Takahiro
Subject TODO-Item: B-tree fillfactor control
Date
Msg-id 20060119095341.4DC7.ITAGAKI.TAKAHIRO@lab.ntt.co.jp
Whole thread Raw
Responses Re: TODO-Item: B-tree fillfactor control  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Hi Hackers,

I'm trying the following TODO item:
  [Indexes]
    - Add fillfactor to control reserved free space during index creation

I have already made an patch and it seemed to work well.

----
$ ./pgbench -i -s 10
# select relpages from pg_class where relname = 'accounts_pkey';
relpages | 2745    ( default PCTFree is 10% )

# set btree_leaf_free_percent = 0;
# reindex index accounts_pkey;
# select relpages from pg_class where relname = 'accounts_pkey';
relpages | 2475    ( <- about 2745 * 0.9 = 2470.5 )

# set btree_leaf_free_percent = 30;
# reindex index accounts_pkey;
# select relpages from pg_class where relname = 'accounts_pkey';
relpages | 3537    ( <- about 2745 * 0.9 / 0.7 = 3529.3 )
----

And now, I need advice on some issues.

- Is it appropriate to use GUC variables to control fillfactors?
    Is it better to extend CREATE INDEX / REINDEX grammar?
- Should indexes remember their fillfactors when they are created?
    The last fillfactors will be used on next reindex.
- Is fillfactor useful for hash and gist indexes?
    I think hash does not need it, but gist might need it.

Look forward to your comments.
Thanks,

---
ITAGAKI Takahiro
NTT Cyber Space Laboratories

Attachment

pgsql-hackers by date:

Previous
From: "Dann Corbit"
Date:
Subject: Re: Surrogate keys (Was: enums)
Next
From: Rod Taylor
Date:
Subject: Re: No heap lookups on index