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

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size?
Date: 2021-05-26 01:33:47
Message-ID: 20210526013347.GG3676@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, May 23, 2021 at 12:25:10PM -0400, Tom Lane wrote:
> However, the more I looked at that code the less I liked it.
> I think the way that compression selection is handled for indexes,
> ie consult default_toast_compression on-the-fly, is *far* saner
> than what is currently implemented for tables. So I think we
> should redefine attcompression as "ID of a compression method
> to use, or \0 to select the prevailing default. Ignored if
> attstorage does not permit the use of compression".

+1

It reminds me of reltablespace, which is stored as 0 to mean the database's
default tablespace.

Also, values are currently retoasted during vacuum full if their column's
current compression method doesn't match the value's old compression.

But it doesn't rewrite the column if the it used to use the default
compression, and the default was changed. I think your idea would handle that.

--
Justin

PS. I just ran into the memory leak that Andres reported and Michael fixed.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2021-05-26 01:33:59 Re: storing an explicit nonce
Previous Message Bruce Momjian 2021-05-26 01:31:02 Re: storing an explicit nonce