Re: Move pg_attribute.attcompression to earlier in struct for reduced size?

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Michael Paquier <michael@paquier.xyz>, Robert Haas <robertmhaas@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>, Andres Freund <andres@anarazel.de>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-06-04T22:51:00Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> It seems to me that most of the overhead is the function call for
> toast_get_compression_id(), so we should get rid of that.

Nice result.  I'm willing to live with 1.5% slowdown ... IME that's
usually below the noise threshold anyway.

> Now, while this patch does seem to work correctly, it raises a number of
> weird cpluspluscheck warnings, which I think are attributable to the
> new macro definitions.  I didn't look into it closely, but I suppose it
> should be fixable given sufficient effort:

Didn't test, but the first one is certainly fixable by adding a cast,
and I guess the others might be as well.

			regards, tom lane



Commits

  1. Remove forced toast recompression in VACUUM FULL/CLUSTER

  2. Rethink definition of pg_attribute.attcompression.

  3. Fix memory leak when de-toasting compressed values in VACUUM FULL/CLUSTER

  4. Re-order pg_attribute columns to eliminate some padding space.

  5. Add more TAP tests for pg_dump with attribute compression