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 1ljyhn-0007K2-6q for pgsql-hackers@arkaria.postgresql.org; Fri, 21 May 2021 06:32:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ljyhm-0001lc-4c for pgsql-hackers@arkaria.postgresql.org; Fri, 21 May 2021 06:32:18 +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 1ljyhk-0001lS-LA for pgsql-hackers@lists.postgresql.org; Fri, 21 May 2021 06:32:17 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljyhh-0001zR-SA for pgsql-hackers@postgresql.org; Fri, 21 May 2021 06:32:15 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id A16B05C00F3; Fri, 21 May 2021 02:32:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 21 May 2021 02:32:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=lvq4UHloHzb/ozn/8j1kWy1uL9R dSK4qy2qCBX0/DpM=; b=elKjZhzOhLfCJZ9dQfKdkvi1aukZpn0ce7I000kiQFM cg3tqjMf48rbC9KKb9MNQsA17a5ZfeucZgChTe+QbkNlDYh2Mmn76zaxr2bO/2wS 6bQSbj15fFjEfjsbByBa4OuUdMZcs+miroAjWP7FCmW1HbsYo8M3GOp1KsqTH3W4 kv3ZHoKH65l6r06XEbPAXFagWi6EVlwzrMNtzDio/O7angk65rZfmXEyjQS9lXEY 07jVyvASAI9h0/o4rf5BjLUOWTPH6/OLuGZVWnFxvRAf/EjHCuKEFghcgefv3nYu ci9qsKWHgEB54eBKpIyOkSvQTUZVXq1NbOOllXhg1DA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=lvq4UH loHzb/ozn/8j1kWy1uL9RdSK4qy2qCBX0/DpM=; b=JNp6laO0aPCUj4aFXzPxkI SU8AiS8QnuP/xgVqnAKd69DkbPqcroc8GYdTNN9nv1z903vcLEEb0VO8Ax35Bod2 3Cv9hYEkToGsQLy6vxCLci3g1Saqe+aGWZsO2jmfI6xPhJwjqtEW0QCt4DJCiUj3 0xWASgZMZw+iPb2GDLrDFlzKJ0zNeAAbeFn/cLvUggrHdkoFwMqjmKX6OiIlpM17 MTW7yraFAJ5stk7fhLYnYVXZ9JEQngsmhp/tzj/4E+VmWzRPFnF9XfRxeZmGUPV7 A7hVN2NfYcuYYzKyBZQ/50fp3Uw7YVLehBKNwYAdsAOw0tk8HE9LwGB8P9VJ5ouw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejvddguddtiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvdegudeuhfdtueeltedtveej heehieevueeigeelteegleejleeiueeiheegvefhnecukfhppeduuddurddutddvrdduke dtrddukeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 May 2021 02:32:09 -0400 (EDT) Date: Fri, 21 May 2021 15:32:05 +0900 From: Michael Paquier To: Andres Freund Cc: Tom Lane , pgsql-hackers@postgresql.org, Dilip Kumar , Robert Haas Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size? Message-ID: References: <20210517204803.iyk5wwvwgtjcmc5w@alap3.anarazel.de> <2854987.1621285592@sss.pgh.pa.us> <20210517212857.qyk4fxykfbxhmxof@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="axEORs+ysS8zkavP" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --axEORs+ysS8zkavP Content-Type: multipart/mixed; boundary="vXeDgoQiTYZ1ng3z" Content-Disposition: inline --vXeDgoQiTYZ1ng3z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --vXeDgoQiTYZ1ng3z Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pg-att-align.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_at= tribute.h index 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_BOO= TSTRAP BKI_ROWTYPE_OID(75, */ bool attbyval; =20 + /* + * 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_BO= OTSTRAP BKI_ROWTYPE_OID(75, char attstorage; =20 /* - * 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'); =20 /* This flag represents the "NOT NULL" constraint */ bool attnotnull; @@ -160,12 +166,6 @@ CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOO= TSTRAP BKI_ROWTYPE_OID(75, /* attribute's collation, if any */ Oid attcollation BKI_LOOKUP_OPT(pg_collation); =20 - /* - * 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. */ =20 @@ -193,7 +193,7 @@ CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOT= STRAP 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)) =20 /* ---------------- * Form_pg_attribute corresponds to a pointer to a tuple with --vXeDgoQiTYZ1ng3z-- --axEORs+ysS8zkavP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmCnU+UACgkQnvQgOdby QH3jvhAAnWsWeJEEAepiCUXoJKV9SlqPo+upGbCn2fFrClbkoUIJ4y0T+/w38ahn lNTCSbn1uTXoCI0nmvGYEAnDJmk+bk/Aoj0Qkjka5pHVysgRgipNlD7FmEf9Z4F9 UfzeBJh1xhmWtsiSgmhc7n0bSHXq/0wAAomFhjonQ6GbebXa5Y0YQ9EpFBp72XiL xdYTT+4geVuYWboJ5h7ikjBrTD1NaxLrB6l/qCkRDLBG1d4HHrCpPq1XDzgAgQjY hhPbqHyn9anKLWkP6dmlaZGzhL5Ei5kBICnV9ixqIwwlcgSDjHN34Ct/htUcNKeB VIkbt9JdCD+vkRV8Y1UPuuHnuHQKkEVfHZLXVNWUCcov957KnD1Ky2gc1DzX/LoG aoYSlvqQoVKCYBMLqDtyAs1sDvMBFyxt4TTW6Q7cu8UJ0ElpWX472ujBJVMbfgum IFmGmRs+ptOwt2cYAv6a8WgE7Y9u1XP5MUEPoFhMMyxYfoJ29ehuD2rlkOHP1dMq ZrOaZnbw5AqPFRRVN3xUu3kEvaJaMt+bXqnU6BlUkLJdOUlzb3hEvKg3PlkQa6ky xlFv+SLRnIfyYWEQxECSt/K+oATXNtA5S995oW/fDmY5xMwOEdt8AGHmHhdEFuLM XQin3JZNVShT3x8LFCZ/VLOah9R6cKFbe73NgEczcrgRfHLBnR8= =WhxZ -----END PGP SIGNATURE----- --axEORs+ysS8zkavP--