RFC/WIP: adding new configuration options to TOAST - Mailing list pgsql-hackers

From Bill Moran
Subject RFC/WIP: adding new configuration options to TOAST
Date
Msg-id 20151103100431.1e9ea80e39b807d7d1f47fc6@potentialtech.com
Whole thread Raw
Responses Re: RFC/WIP: adding new configuration options to TOAST  (Craig Ringer <craig@2ndquadrant.com>)
List 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

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: shm_mq fix for non-blocking mode
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: multiple psql option -c