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 1lmOG2-0006R8-1S for pgsql-hackers@arkaria.postgresql.org; Thu, 27 May 2021 22:13:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lmOG0-0000C0-LW for pgsql-hackers@arkaria.postgresql.org; Thu, 27 May 2021 22:13:36 +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 1lmOCw-0002B9-79 for pgsql-hackers@lists.postgresql.org; Thu, 27 May 2021 22:10:26 +0000 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lmOCs-0008OE-O4 for pgsql-hackers@postgresql.org; Thu, 27 May 2021 22:10:25 +0000 Received: by mail-ot1-x331.google.com with SMTP id h24-20020a9d64180000b029036edcf8f9a6so1705955otl.3 for ; Thu, 27 May 2021 15:10:22 -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=nTpi225lYjEv//VIkrIkvXjuGbQmIL6mJd5HbxfgpTk=; b=GPUfMBFMZibsyfD/JXOl7KCw6bpkbRxhZ9t45ZzIX1NRCWhOnD3b75k1jjZ6bdUoX/ KeVhQPlRFGECbepnQxO5Yf0vFX9zAHTVSuabD1RMRbFMRErXmppY7LFWDWH2wCxx92+S 1Tt8sOarRfQKoVSQ92/edRoYAlvGwwX90qn7MDfwm9IDBf9oTZy27l0bqqutpGr0E0Fh zOtF957H8f8Ulj8ENtpEKfiEqlW5h0oTE4hFzlPiqQaUbdMXBNYT3dKiZ//WqJI4F3Vx ODCeJTpOeWsOX52iANfgRGRCXuRlaFHUtYOjkITMIwtwqmcXTGwstcdCw/+x5oD3SdpH ZMFA== 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=nTpi225lYjEv//VIkrIkvXjuGbQmIL6mJd5HbxfgpTk=; b=dGoKANmYs9y43/20Z454g+1yeutTm94+uXu1H3y2xtw7/KDLUHUhQ2CHMySrjJIR5Z wCZ1SzIYvzgV6aAEWtPrKgF7qi4RjsrV/+mLZCksHqh7Bs/sYU9Bf1Gv/kRS6gfna+cM 9WX81joqHnI2kM4btDTgh0B9GiLVXaqzWwaLLpr9ioIftJ7ks3sB4NgzBhMrdbOAAJqr cB0vfFjtEbCbaZlIwyCjm0fBHEpeweenr5VsNpQ2T8OAVnynb/e6flREul7e+pUNfns8 LDsy7QlVT8Zul9xCfR5OPMaxQIV3q/kmaEtA2vVGVTk1Vcz+nSKwkgL2feYLW+5m/EuO RVsA== X-Gm-Message-State: AOAM533GykJdyeF2Eh0sdXzjXxKZZ7MLWlStBT7Vd4GaTGj/xzBLUij2 BBmgCWbMvHANZMIma1z78/htpg== X-Google-Smtp-Source: ABdhPJwKM6GOCnQxS+irOlsM9ibD7rZRFfKbVTmSi4E6YfdbroMf0N+UHx3wviaf7lG5Umwsp30bDw== X-Received: by 2002:a05:6830:20c6:: with SMTP id z6mr4738076otq.26.1622153421315; Thu, 27 May 2021 15:10:21 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id v9sm784521otn.44.2021.05.27.15.10.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 May 2021 15:10:20 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 9BFCF8009D6; Thu, 27 May 2021 17:10:19 -0500 (CDT) Date: Thu, 27 May 2021 17:10:19 -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: <20210527221019.GG2082@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210526013347.GG3676@telsasoft.com> 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 Tue, May 25, 2021 at 08:33:47PM -0500, Justin Pryzby wrote: > 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. I was surprised to realize that I made this same suggestion last month... https://www.postgresql.org/message-id/20210320074420.GR11765@telsasoft.com |..unless we changed attcompression='\0' to mean (for varlena) "the default |compression". Rather than "resolving" to the default compression at the time |the table is created, columns without an explicit compression set would "defer" |to the GUC (of course, that only affects newly-inserted data). The original reason for that suggestion Michael handled differently in 63db0ac3f9e6bae313da67f640c95c0045b7f0ee -- Justin