Thread: fillfactor for toast tables is useless?

fillfactor for toast tables is useless?

From
ITAGAKI Takahiro
Date:
With reloption patch, we can set WITH options to toast tables.
However, fillfactor for toast tables is useless, no?
(autovacuum options will work as expected, though.)

Tuples in toast tables are never updated. When the main tuple is updated,
old toast tuples are deleted and new ones are inserted. Even if there are
some freespaces in pages of toast table, they are never used by inserts.
I think we should not allow users to modify fillfactor for toast tables
and it should be always 100%.

We could optimize a delete+insert operation for toast tuples to one update
when the number of chunks are not changed by update.
Fillfactor for toast tables will be only useful after the optimization.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center



Re: fillfactor for toast tables is useless?

From
Alvaro Herrera
Date:
ITAGAKI Takahiro wrote:
> With reloption patch, we can set WITH options to toast tables.
> However, fillfactor for toast tables is useless, no?

Maybe what we should do is just reject fillfactor for toast tables for
now.  I think this is easy to do.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: fillfactor for toast tables is useless?

From
ITAGAKI Takahiro
Date:
Alvaro Herrera <alvherre@commandprompt.com> wrote:

> ITAGAKI Takahiro wrote:
> > With reloption patch, we can set WITH options to toast tables.
> > However, fillfactor for toast tables is useless, no?
>
> Maybe what we should do is just reject fillfactor for toast tables for
> now.  I think this is easy to do.

Hmmm... this might have been discussed already, I think it would be better
to have relopt_kind not as a sequence number but as a bit flag.
If it was flags, we can reject fillfactor for toast tables in a natural way
without duplicated autovacuum_* definitions:

  - fillfactor   -> RELOPT_KIND_HEAP
  - autovacuum_* -> RELOPT_KIND_HEAP | RELOPT_KIND_TOAST

26 entries are remained even after we use 6 kinds in the core.
(HEAP, TOAST, BTREE, HASH, GIN and GIST)

The attached is a patch to change 3 things:
  - Reject toast.fillfactor.
  - Modify relopt_kind to bit flags.
  - Report relation type on "unrecognized parameter" errors.

Comments welcome.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


Attachment

Re: fillfactor for toast tables is useless?

From
ITAGAKI Takahiro
Date:
ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> wrote:

> The attached is a patch to change 3 things:
>   - Reject toast.fillfactor.
>   - Modify relopt_kind to bit flags.
>   - Report relation type on "unrecognized parameter" errors.

I registered the patch as an open item:
http://wiki.postgresql.org/wiki/PostgreSQL_8.4_Open_Items

Comments and discussions welcome.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center