Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llzGn-00026V-Cz for pgsql-hackers@arkaria.postgresql.org; Wed, 26 May 2021 19:32:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1llzGm-0007Ha-Am for pgsql-hackers@arkaria.postgresql.org; Wed, 26 May 2021 19:32:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llzGl-0007H4-Vi for pgsql-hackers@lists.postgresql.org; Wed, 26 May 2021 19:32:44 +0000 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1llzGj-0003O9-Ck for pgsql-hackers@postgresql.org; Wed, 26 May 2021 19:32:43 +0000 Received: by mail-il1-x12a.google.com with SMTP id g11so1963025ilq.3 for ; Wed, 26 May 2021 12:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MQl8z96oE4MstbabF7YdXcn60hIHqKtOOindrwInkDk=; b=MrEezanm5cucHAjesdE0Yj0m8IxA/qWmXN9WpssaUB3LDQxlooopNo7cfLwxmJXuEh ub5o71lkY0YgU4lBB3Vx4AtA/0FDfc+eNzZSj3cRV0Gxb17vYhkJLplP5enqu6ldYOng gtkByxq4QlPQRcNyjMLhZYlZazp/lUkWumov3eP5ACwZgQm6/ZiZUzh+67vCVX2N5bf/ Tiyc1qaLvuQFxGzDGfIzF8SWhG2k9bXMXL6p1PcLmyvDw6UEhY0+K+ZfTWUkCmDafc71 DdT1un5Kh0Kl8fcfd+ySACG+nX61Pg6ERMFmGj/GPducV/Ue2AIhyd/qc02hIqmq1u0w pSIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MQl8z96oE4MstbabF7YdXcn60hIHqKtOOindrwInkDk=; b=U+vsVtF0kI9iv8Cj+CrwKeuS3MPWk/bxl/XxFv8wiy8CmlpAJA+Mkb03xQJVt/o5cV q1JZZoArvtfP3qUaAA+44HaTkLBo3ojvtfBUzTo2e3Y7mqByuNqtZ1AFLRhASp6YvHFA mZrno6ffoG8Nk5q2cDXvu//9pO4NQ45McrM9CB9GE/DlEepoT4YmE1z8X8MQdDObmUIY k539YXvlGp/UvrTvwKD4It6obCrx4LUFYs34WvW8aPaYg7MSI62brWOVkSgEIaQhP46k 5QAirhm2/39oNuHSzhv4z91RbIOLOzfivZXdeSL6ru4mHmtKt9qj+Pyy+rXrzywZxlNk XnlA== X-Gm-Message-State: AOAM533CTbVdStYx4SfCY72pMbxMt0Fe16JfEbBEZ2RI+7wAF4Wrtrvt +jxsE7osyijoI3ekzzGlYqznmA== X-Google-Smtp-Source: ABdhPJzQXnqQcBWj9FR7ZsWMgSpSCvo3oyYGJEFcP+8gCpmg+1C3lih2qThKgAoo7jxUcJInD0CSaQ== X-Received: by 2002:a92:cda7:: with SMTP id g7mr23638952ild.50.1622057559710; Wed, 26 May 2021 12:32:39 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id d5sm115575ilf.55.2021.05.26.12.32.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 May 2021 12:32:39 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 32481800AB7; Wed, 26 May 2021 14:32:38 -0500 (CDT) Date: Wed, 26 May 2021 14:32:38 -0500 From: Justin Pryzby To: Tom Lane Cc: Michael Paquier , Andres Freund , pgsql-hackers@postgresql.org, Dilip Kumar , Robert Haas Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size? Message-ID: <20210526193237.GM3676@telsasoft.com> References: <20210517204803.iyk5wwvwgtjcmc5w@alap3.anarazel.de> <2854987.1621285592@sss.pgh.pa.us> <20210517212857.qyk4fxykfbxhmxof@alap3.anarazel.de> <3962395.1621609263@sss.pgh.pa.us> <626613.1621787110@sss.pgh.pa.us> <20210526013347.GG3676@telsasoft.com> <1505124.1622042026@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1505124.1622042026@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, May 26, 2021 at 11:13:46AM -0400, Tom Lane wrote: > Michael Paquier 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