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 1lliQm-0002oy-05 for pgsql-hackers@arkaria.postgresql.org; Wed, 26 May 2021 01:33:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lliQk-0003o8-WA for pgsql-hackers@arkaria.postgresql.org; Wed, 26 May 2021 01:33:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lliQk-0003o0-ME for pgsql-hackers@lists.postgresql.org; Wed, 26 May 2021 01:33:54 +0000 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lliQg-0002Jt-7A for pgsql-hackers@postgresql.org; Wed, 26 May 2021 01:33:53 +0000 Received: by mail-io1-xd36.google.com with SMTP id b25so15350660iot.5 for ; Tue, 25 May 2021 18:33:50 -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=LL9Ste4tGPGXigmmQf12Mu3uvce1rClJRsX2vCCBWuc=; b=wRDHf1TLOL+MjD0ovil5Byor5/CiIBOBpuytkhYipUnrHtKvbIQlhqdKJTYltfmAX0 uHid84rffXrUxbu/X7OOUO+v5DE22PJ+WM1etMp7jjByjx/SoZi7MgyJ0Cs/HLTqhVe2 0qmjwtA+xjOBVZYW7AvU7Ic14G5u5Koj/VngCJ1KZ1FPJQo2BQbhM+c2ktgRUErLQjoq 83q43umIPQRuNuUcUvpS7GaOzgeETvlxjaDD0Z8DQ9lDlRQwvpRHfttU+ukDwfEDhsbl Pjf500Dyb775D3f2ZN2e/JbCe3TPm28p9gWIhYU+H16ypd+eRTCtV7eNasFjfsUrFuvj gpZA== 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=LL9Ste4tGPGXigmmQf12Mu3uvce1rClJRsX2vCCBWuc=; b=HbL7AeTX1husJkr/DPR249fE+vnManvXb30umjxA3iwEPb6sPYMUwB02GcDDN1qqDX ZrzCSydKEuOxUtTUZxVmL+LDBXjoSy9PgzpUrTVd0wJIkJ09hOcQmgzpZQVTIVu+rCHo F6kkJXPVYCVLI9xAwncwmZVMgvLZKuQuO1T9PP878XIEFj3jn1L4claYJBosFSmegi6c nRzolz64/Knd4ov/HOO33RvnlYj9OuyJdpA+kL2kCOsbJhSWNWyDVkv55RXdrH5GG7tm XO1nXTuMHUOtolMYWqkqFmwZfKCz6ir1vUFho21OurdWaQpArMmzMotl6kA/qW9hiNf7 AJ8w== X-Gm-Message-State: AOAM533tq/O+2wO+VZzTAKDmbVhjx4AzNEMv2AMs9D8rq9Rp2rfeXn/3 3wXSeTt3x5ntf7kIzwPXN1dvIg== X-Google-Smtp-Source: ABdhPJwsfS2GlNSnEIVtgSkqHvfxPWerPrYEytCT8EnWQ0yW5vhTDLNx6Atqdm6NrDgZQYBBki1sLw== X-Received: by 2002:a02:7702:: with SMTP id g2mr499502jac.111.1621992829425; Tue, 25 May 2021 18:33:49 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id g6sm5082623iln.88.2021.05.25.18.33.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 May 2021 18:33:48 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 73F43800C82; Tue, 25 May 2021 20:33:47 -0500 (CDT) Date: Tue, 25 May 2021 20:33:47 -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: <20210526013347.GG3676@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <626613.1621787110@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 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.