From: Michael Paquier <michael@paquier.xyz>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
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: Fri, 21 May 2021 15:32:05 +0900
Message-ID: <YKdT5ZM5OInCsDkM@paquier.xyz> (raw)
In-Reply-To: <YKMXVHCoNGZ61E9q@paquier.xyz>
References: <20210517204803.iyk5wwvwgtjcmc5w@alap3.anarazel.de>
<2854987.1621285592@sss.pgh.pa.us>
<20210517212857.qyk4fxykfbxhmxof@alap3.anarazel.de>
<YKMXVHCoNGZ61E9q@paquier.xyz>
On Tue, May 18, 2021 at 10:24:36AM +0900, Michael Paquier wrote:
> If you switch attcompression, I'd say to go for the others while on
> it. It would not be the first time in history there is a catalog
> version bump between betas.
This is still an open item. FWIW, I can get behind the reordering
proposed by Tom for the consistency gained with pg_type, leading to
the attached to reduce the size of FormData_pg_attribute from 116b to
112b.
--
Michael
Attachments:pg-att-align.patch (text/x-diff, 2.0K) downloaddiff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_attribute.hindex 560f8f00bb..b47e5fa2e7 100644--- a/src/include/catalog/pg_attribute.h+++ b/src/include/catalog/pg_attribute.h@@ -111,6 +111,12 @@ CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(75,
*/
bool attbyval;
+ /*+ * attalign is a copy of the typalign field from pg_type for this+ * attribute. See atttypid comments above.+ */+ char attalign;+
/*----------
* attstorage tells for VARLENA attributes, what the heap access
* methods can do to it if a given tuple doesn't fit into a page.
@@ -120,10 +126,10 @@ CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(75,
char attstorage;
/*
- * attalign is a copy of the typalign field from pg_type for this- * attribute. See atttypid comments above.+ * compression method. Must be InvalidCompressionMethod if and only if+ * typstorage is 'plain' or 'external'.
*/
- char attalign;+ char attcompression BKI_DEFAULT('\0');
/* This flag represents the "NOT NULL" constraint */
bool attnotnull;
@@ -160,12 +166,6 @@ CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(75,
/* attribute's collation, if any */
Oid attcollation BKI_LOOKUP_OPT(pg_collation);
- /*- * compression method. Must be InvalidCompressionMethod if and only if- * typstorage is 'plain' or 'external'.- */- char attcompression BKI_DEFAULT('\0');-
#ifdef CATALOG_VARLEN /* variable-length fields start here */
/* NOTE: The following fields are not present in tuple descriptors. */
@@ -193,7 +193,7 @@ CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(75,
* can access fields beyond attcollation except in a real tuple!
*/
#define ATTRIBUTE_FIXED_PART_SIZE \
- (offsetof(FormData_pg_attribute,attcompression) + sizeof(char))+ (offsetof(FormData_pg_attribute,attcollation) + sizeof(Oid))
/* ----------------
* Form_pg_attribute corresponds to a pointer to a tuple with
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, andres@anarazel.de, tgl@sss.pgh.pa.us, dilipbalaut@gmail.com, robertmhaas@gmail.com
Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size?
In-Reply-To: <YKdT5ZM5OInCsDkM@paquier.xyz>
* 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