RFC/WIP: adding new configuration options to TOAST

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: RFC/WIP: adding new configuration options to TOAST
Date: 2015-11-03 15:04:31
Message-ID: 20151103100431.1e9ea80e39b807d7d1f47fc6@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Looking for feedback to see if anyone sees any issues or has any
suggestions on what I'm doing. The attached patch alters 3 things
with regard to TOAST behavior:

1) Add a GUC target_compression_ratio: When attempting to
compress a datum in the TOAST code, only stored the compressed
version if it saves at least target_compression_ratio% space.

2) Add a constant COMPRESSION_TEST_SIZE: If a datum is larger
than this size, initially COMPRESSION_TEST_SIZE bytes are
compressed, and the entire datum is only compressed if the
test compression indicates that it might be worth it. The
goal is to avoid the CPU of compressing a large value that
isn't going to save space anyway.

3) Add a GUC target_tuple_size: which exposes the "fit at least
4 tuples on a page" logic as a configurable value. The value
is exposed as a maximum desired size (instead of the target
tuples to fit on a page) because that seems like a more
intuitive configuration option to me.

If this seems to be on track, then my next step is to make these
values configurable on a per-table basis.

I'm tracking my work on github, if that's easier to review than
the patch for anyone: https://github.com/williammoran/postgres

--
Bill Moran

Attachment Content-Type Size
toast_patch_v1.diff text/x-diff 9.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2015-11-03 15:16:48 Re: proposal: multiple psql option -c
Previous Message Robert Haas 2015-11-03 15:00:06 Re: shm_mq fix for non-blocking mode