table/index fillfactor control, try 2

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-patches(at)postgresql(dot)org
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: table/index fillfactor control, try 2
Date: 2006-06-16 04:33:43
Message-ID: 20060616122755.C995.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

This is a revised fillfactor patch. It uses WITH syntax and
we can add new AM specific parameters easily.

Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:

> I see what Tom was driving at with earlier comments. I think we need an
> non-index AM specific patch, so that each AM has its own parameters.

I added amparseoption and amdumpoption to pg_am. The amparseoption parses
options and convert them to an internal structure per AM. The amdumpoption
converts the structure to a human-readable text to dump the definition.
It might be better to make the result of amdumpoption to be a list of
(name, value) pairs instead of a plain text.

> So we have a new element of the RelationData struct:
> void *rd_amopts;
> Which each AM defines and interprets.

The internal structure is stored in the pg_class.relamopaque column as bytea.
I guess it is not the best and there is room for discussion. I examined the
following ideas, but they had complexities and difficulties.

1. Add AM specific system tables (pg_heap, pg_btree, etc.) that may inherit
pg_class. But it will impact the current source code terribly.
2. Store the structures in AM's meta page. But heaps don't have meta pages.
3. Store them into an array of text column that newly added to pg_class.
But we hove to re-parse the array every time relations are loaded.
4. Add new system table, pg_class_option (relid, option name, value).
But it has same problem as 3 and needs additional heap scannings.

Therefore, I choose the as-is binary format to store the internal structures.
Any comments or better ideas?

---
ITAGAKI Takahiro
NTT Open Source Software Center

Attachment Content-Type Size
fillfactor-0616.patch.gz application/octet-stream 32.2 KB
fillfactor.sql application/octet-stream 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Qingqing Zhou 2006-06-16 04:48:27 Re: Test request for Stats collector performance improvement
Previous Message mark 2006-06-16 04:04:15 Re: Preventing DELETE and UPDATE without a WHERE clause?

Browse pgsql-patches by date

  From Date Subject
Next Message Qingqing Zhou 2006-06-16 04:48:27 Re: Test request for Stats collector performance improvement
Previous Message Chander Ganesan 2006-06-16 04:21:14 Re: Omitting tablespace creation from pg_dumpall...