table/index fillfactor control

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-patches(at)postgresql(dot)org
Subject: table/index fillfactor control
Date: 2006-06-06 09:02:19
Message-ID: 20060606163803.539A.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

This is a patch for table/index fillfactor control discussed in
http://archives.postgresql.org/pgsql-hackers/2006-06/msg00175.php
Fillfactor works on CREATE, INSERT, UPDATE, COPY, VACUUM FULL, CLUSTER
and REINDEX, but is not done on dump/restore and GIN access method;
I'd like to ask those module developers to complete the patch, please.

This patch might help the TODO-item:
Allow CREATE INDEX to take an additional parameter for use with
special index types
but the patch rejects parameters except fillfactor currently.
If we want to implement the feature, it is needed to consider how to
store generic parameters passed at CREATE.

The following syntax are added:
- Table creation:
- CREATE TABLE table (columns) WITH (...)
- CREATE TABLE table WITH (...) AS SELECT/EXECUTE ...
- Index creation:
- CREATE INDEX index ON table USING btree (columns) WITH (...)
- CREATE TABLE table (i integer PRIMARY KEY WITH (...))
- ALTER TABLE table ADD PRIMARY KEY (columns) WITH (...)
- Alterating parameters for existing tables/indexes:
- ALTER TABLE/INDEX name SET (...)

The folloing is a test of the patch:

# CREATE TABLE tbl (i int) WITH (fillfactor=50);
# CREATE INDEX idx ON tbl USING btree (i) WITH (fillfactor=50);
# INSERT INTO tbl SELECT generate_series(1, 100000);

| relname | relfillfactor | relpages |
+---------+---------------+----------+
| tbl | 50 | 1087 |
| idx | 50 | 494 |

# ALTER TABLE tbl SET (fillfactor = 100);
# ALTER INDEX idx SET (fillfactor = 100);
# CLUSTER idx ON tbl;
# REINDEX INDEX idx;

| relname | relfillfactor | relpages |
+---------+---------------+----------+
| tbl | 100 | 541 |
| idx | 100 | 249 |

---
ITAGAKI Takahiro
NTT OSS Center

Attachment Content-Type Size
fillfactor-0606.patch.gz application/octet-stream 19.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Travis Cross 2006-06-06 09:45:26 Duplicate rows sneaking in despite PRIMARY KEY / UNIQUE constraint
Previous Message Peter Eisentraut 2006-06-06 07:53:27 Re: Why do we want to %Remove behavior of postmaster -o

Browse pgsql-patches by date

  From Date Subject
Next Message ITAGAKI Takahiro 2006-06-06 09:51:34 'Index Full Scan' for Index Scan without Index Cond
Previous Message Victor B. Wagner 2006-06-06 07:51:35 Contrib module to examine client certificate