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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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:57:00
Message-ID: YK2q7K+DrsgiMb0Q@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 25, 2021 at 08:33:47PM -0500, Justin Pryzby wrote:
> 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.

Ah, the parallel with reltablespace and default_tablespace at database
level is a very good point. It is true that currently the code would
assign attcompression to a non-zero value once the relation is defined
depending on default_toast_compression set for the database, but
setting it to 0 in this case would be really helpful to change the
compression methods of all the relations if doing something as crazy
as a VACUUM FULL for this database. Count me as convinced.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-05-26 01:57:47 Re: storing an explicit nonce
Previous Message Bruce Momjian 2021-05-26 01:51:31 Re: storing an explicit nonce