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 1lqoq2-0005jG-6h for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jun 2021 03:25:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqoq1-000266-64 for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jun 2021 03:25:05 +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 1lqoq0-00025s-Uc for pgsql-hackers@lists.postgresql.org; Wed, 09 Jun 2021 03:25:04 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqopz-0007Sa-1S for pgsql-hackers@postgresql.org; Wed, 09 Jun 2021 03:25:03 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 19EDC5C020A; Tue, 8 Jun 2021 23:25:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 08 Jun 2021 23:25:02 -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=PCJbORkkeDI0e0UG4sQtBfjEYSh 98/9SNGLg6zdDHs0=; b=CX+Vbs3D+wm49YAHeeUOAPVbXkNJA48XjSgXVPq++dd SslKioL/WpapIqJrOx3A8lbCNYqM2ypPmWJmh8ck1Mrh+b4H8H2Y0aybCJVl5yAS 1+PFuPO/Q6nwIeIQUCV/ACW8LvHm4+MI/XQ/QDgrKqWRs3WCKYVv6tdEkBkmuBEY wte6RQGacubHyAj9GHDtaQ0X5x+XX7iMcifMi2RAY3UO0UdNTd5F6upMluQ5i/of GKNzutjtVbGo/ek3DRgopGQgg/qjldyTXnUCVAt9wP2steAGaYwzZjc2d1PIKhHw ZmbOAjg5Z73eieG00Fdhoqvn6i0jx65KxnxiIb+Uksg== 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=fm3; bh=PCJbOR kkeDI0e0UG4sQtBfjEYSh98/9SNGLg6zdDHs0=; b=ZX58gkPGAiS1E8Ov8pVg7Q a3IuZKZOXh3HZ28Sr+e5/WFHDSx4cEMT1n9ODXALHQieH2lBTmqaNEC2Lcf83KEz 8KgnaAoi21u0umpvlIDBxZwvxFkGvJ//ORcumMkKNkhQfRbUx6tg2vbG7+Q/TsKD NOWnSNiiwef2TVBCD4EDnSG/FS7QXtk+ONDwiwqJr9KGs4eBU0IW97KZRrnEefG3 4/UnbxU7IXiQLfdHDe6c53uK3yKlh5W3BdocuWxLYeBUiQRLw5PjcFc64ZNOB8Sq EOI9TScu3NS6as8pvIh0xV8irVxzy4NA5Kp2CIslb953a0fxFrcW0HCgCQdbyLSA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedutddgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 8 Jun 2021 23:24:59 -0400 (EDT) Date: Wed, 9 Jun 2021 12:24:57 +0900 From: Michael Paquier To: Alvaro Herrera Cc: Tom Lane , Robert Haas , Dilip Kumar , Andres Freund , pgsql-hackers Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size? Message-ID: References: <202106081439.m2pwwk5yvcrd@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BZxg5mtkG0HCPN61" Content-Disposition: inline In-Reply-To: <202106081439.m2pwwk5yvcrd@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --BZxg5mtkG0HCPN61 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jun 08, 2021 at 10:39:24AM -0400, Alvaro Herrera wrote: > My unverified guess is that this code causes too many pipeline stalls > while executing the big per-column loop. Maybe it would be better to > scan the attribute array twice: one to collect all data from > Form_pg_attribute for each column into nicely packed arrays, then in a > second loop process all the recompressions together ... the idea being > that the first loop can run without stalling. You mean for attlen and attcompression, right? I agree that it would help. A extra set of things worth it here would be to move the allocation and memset(0) of values_free from reform_and_rewrite_tuple(), and do the round of pfree() calls if at least one value has been detoasted. > Maybe at this point reverting is the only solution. That's a safe bet at this point. It would be good to conclude this one by beta2 IMO. -- Michael --BZxg5mtkG0HCPN61 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmDANIkACgkQnvQgOdby QH1ebA/6A0UENxWFU1lbJVfRbE5yl9GffvDmuqiitZWg3bixMNWvXqBfqcPa10xd Xq56pWIZmf56ue5O12HVhHnRnck/meXMugFyxobNbHur5HTymG7jO2Z1zSZwn48L p0Krw+kxsHz9p6hSj4dFa/u93mvRPwpCTwhaLPfIfAiZ1bZNbf7BQP7nsO4sXhyS NZ7ArBbUP5t0SuRV2j7uper53YxZQ5dAn6WmjTtM9ifMxxfE0zN4KQ8T+YXemmUd 8+4NnvB7z7vntMySfTqAQvB+wdnTfHDUXc0XdJSGuyjcFPyoBTRE2RHnjRJTVtE8 Y4Dy+hEUPDN5K86nvO9+gLzidd320i2NtLYbJZkhbkrBZRDZcV1Tm1xy42XI2m7/ yx8X5jS4LbMqf77Y51TVdukRBKAg0Kyd9FJ292KTvoId8OiH0t70+OaaYGmN0ATP WvEsKU5PLMslLWAp5+WWet5QsFYEkjVx8zanxAkU6WSzMn5yEuncWsmMXQ5Yw0Rk 6DoexmKEZl1Rnw+qQDoeYLwzGCbkC3JQ5LJZGXwb7p4QT25qpMnO1zzl5XG5HY0n Qa7kWnMfz6MvhH8n5CZMn5rdVU11DO2ueoq0zpFXsnb0b3o3zsvI0HszdurUQw6t AAYCzVyQaUsQ0m7vkyaZ0adwQlSyqj3CGHuv4CD9Ojz1P8HAWXs= =yVq/ -----END PGP SIGNATURE----- --BZxg5mtkG0HCPN61--