pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Dilip Kumar <dilipbalaut@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size?
Date: Wed, 26 May 2021 14:32:38 -0500
Message-ID: <20210526193237.GM3676@telsasoft.com> (raw)
In-Reply-To: <1505124.1622042026@sss.pgh.pa.us>
References: <20210517204803.iyk5wwvwgtjcmc5w@alap3.anarazel.de>
	<2854987.1621285592@sss.pgh.pa.us>
	<20210517212857.qyk4fxykfbxhmxof@alap3.anarazel.de>
	<YKMXVHCoNGZ61E9q@paquier.xyz>
	<YKdT5ZM5OInCsDkM@paquier.xyz>
	<3962395.1621609263@sss.pgh.pa.us>
	<626613.1621787110@sss.pgh.pa.us>
	<20210526013347.GG3676@telsasoft.com>
	<YK2q7K+DrsgiMb0Q@paquier.xyz>
	<1505124.1622042026@sss.pgh.pa.us>

On Wed, May 26, 2021 at 11:13:46AM -0400, Tom Lane wrote:
> Michael Paquier <michael@paquier.xyz> writes:
> > 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.
> 
> Here's a draft patch series to address this.
> 
> 0001 removes the relkind checks I was questioning originally.
> As expected, this results in zero changes in check-world results.
> 
> 0002 is the main change in the semantics of attcompression.
> This does change the results of compression.sql, but in what
> seem to me to be expected ways: a column's compression option
> is now shown in \d+ output only if you explicitly set it.
> 
> 0003 further removes pg_dump's special handling of
> default_toast_compression.  I don't think we need that anymore.
> AFAICS its only effect would be to override the receiving server's
> default_toast_compression setting for dumped/re-loaded data, which
> does not seem like a behavior that anyone would want.
> 
> Loose ends:
> 
> * I've not reviewed the docs fully; there are likely some more
> things that need updated.
> 
> * As things stand here, once you've applied ALTER ... SET COMPRESSION
> to select a specific method, there is no way to undo that and go
> back to the use-the-default setting.  All you can do is change to
> explicitly select the other method.  Should we invent "ALTER ...
> SET COMPRESSION default" or the like to cover that?  (Since
> DEFAULT is a reserved word, that exact syntax might be a bit of
> a pain to implement, but maybe we could think of another word.)
> 
> * I find GetDefaultToastCompression() annoying.  I do not think
> it is project style to invent trivial wrapper functions around
> GUC variable references: it buys nothing while requiring readers
> to remember one more name than they would otherwise.  Since there
> are only two uses remaining, maybe this isn't very important either
> way, but I'm still inclined to flush it.

+1

It existed when default_toast_compression was a text string.  Since e5595de03,
it's an enum/int/char, and serves no purpose.

-- 
Justin





view thread (73+ messages)  latest in thread

Message-ID: <20210526193237.GM3676@telsasoft.com>
Permalink:  ../20210526193237.GM3676@telsasoft.com/
Also on:    postgresql.org/message-id/20210526193237.GM3676@telsasoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: pryzby@telsasoft.com, tgl@sss.pgh.pa.us, michael@paquier.xyz, andres@anarazel.de, dilipbalaut@gmail.com, robertmhaas@gmail.com
  Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size?
  In-Reply-To: <20210526193237.GM3676@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox