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 1lqctB-0004zC-To for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Jun 2021 14:39:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqctA-000107-2V for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Jun 2021 14:39:32 +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 1lqct9-0000zy-R6 for pgsql-hackers@lists.postgresql.org; Tue, 08 Jun 2021 14:39:31 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqct7-0001Xy-Jw for pgsql-hackers@postgresql.org; Tue, 08 Jun 2021 14:39:30 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 74F115C0135; Tue, 8 Jun 2021 10:39:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 08 Jun 2021 10:39:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=hwV+px/sZ6E3qliXW5hoEFY3CGj50fnCptfYjwTQfeY=; b=mc2BzDHT p9XbUGxfmBWIXxIG3At4hlx4H0ynxxSqEhI6lni7JYE8fnZDL2EkwL6XMMbA2YLC MCOHoNsPeF6StIe0OBdXydwzfhKgRUPO/n/jJ0qamyEIiZi6AuuId2iEv8N25atf eHj9RkZNLKrpe3hfJrOq5iARbephizkcOz0sXjKe6CEmOrYwplbzJtnx2mFCcyls plQ/qJXVZr3kk5chw8g0vTCda2zE/Q3tQ6pvSY8nud5zgoqeI7S29AQlTRJaxYaV 3RaoK11OP64ZUlPeQ1oTbgbxHS+8vrvFF8F2H2KMyBsUS/3J4nOaVw3WlAAj0DtW ZRh5mbnL9Dk4iA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedtledgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttddunecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeekkeelvefgieduleffieegkedvledtledvveeiteeltdet hfefffelffekjeefleenucffohhmrghinhepphhoshhtghhrrdgvshenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 8 Jun 2021 10:39:27 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D2AC42A0BBD; Tue, 8 Jun 2021 10:39:24 -0400 (-04) Date: Tue, 8 Jun 2021 10:39:24 -0400 From: Alvaro Herrera To: Michael Paquier 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: <202106081439.m2pwwk5yvcrd@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Jun-06, Michael Paquier wrote: > On Fri, Jun 04, 2021 at 07:21:11PM -0400, Alvaro Herrera wrote: > The test has been done with four configurations, and here are the > results: > 1) HEAD: 9659ms > 2) REL_13_STABLE: 8310ms. > 3) Alvaro's patch, as of > https://postgr.es/m/202106042321.6jx54yliy2l6@alvherre.pgsql: 9521ms. > 4) My patch applied on HEAD, as of > https://postgr.es/m/YLm5I9MCGz4SnPdX@paquier.xyz: 8304ms. Hmm, ok. Trying to figure out what is happening would require more time than I can devote to this at present. 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. Maybe at this point reverting is the only solution. -- Álvaro Herrera 39°49'30"S 73°17'W "Oh, great altar of passive entertainment, bestow upon me thy discordant images at such speed as to render linear thought impossible" (Calvin a la TV)