Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xEqI6-00000001IsY-2cvS for pgsql-committers@arkaria.postgresql.org; Thu, 08 Oct 2026 15:44:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xEqI5-0000000Cnmq-2aWm for pgsql-committers@arkaria.postgresql.org; Thu, 08 Oct 2026 15:44:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xEqI5-0000000Cnmi-1aSk for pgsql-committers@lists.postgresql.org; Thu, 08 Oct 2026 15:44:17 +0000 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xEqI3-000000010hz-1agw for pgsql-committers@lists.postgresql.org; Thu, 08 Oct 2026 15:44:16 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 411A6EC02BF for ; Thu, 8 Oct 2026 11:44:14 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 08 Oct 2026 11:44:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1791474254; x=1791560654; bh=C2LxcrKSwrjwMyJzJpuky57VT2/5i1ie xdtCJ/WOyhs=; b=lphirQIvbVpyp8dYgSiAIfGU1ynoU1U04MhP1wYuRXXYvzKO kQwh6BZVMlr5p0VPEIl2MCOMoTHK6sOCPFQ9L1dS+c8RohHNXybH1aFhzR2Bl4VG UvplXMG4m37VExBBIlD1EO1AFq9YTPrhgrLzF3DJUCL1R8R0uww3H+uYy4uk0zI8 r0dCAcznew1zptR/Ut90Cz00JoUivhh00ycRxKWKRgsnnjrbuuFAzE0Jc/eRzred yIi7BUt/oaTFwihwoB7PFV5SWLmyZXU1IQUF4MD7iKh7gSyEd9MGYEKDZ5Ik2TJ4 y9fJmyntLavpLMM+UcmbdoW4ldQFgwUU3DUAMw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1791474254; x= 1791560654; bh=C2LxcrKSwrjwMyJzJpuky57VT2/5i1iexdtCJ/WOyhs=; b=K 36siJ/vkxYcVPU3WeL6hXBIYdRatBcCc8a//ICf0ap9a99UsT6vIgD68+vmZNaXt zZ4y3PzyTJIpOppOAOg+KORGHNbpl/ZMvAhfAul6ije1SVORO4CLbgipduAVB5J6 HacpEBFNmRcRAnOLT2MtCc2q/oSj57x6VPnU6iIcL9poCmCJojsYmeWDW4bh74o6 4gZfpUI6uHvM4N4h63jEx5UhEyBPGWAy+UFoPbszyy9ReZ9XC4J9pArkmfH1ShHD BSGt9/5vTxI05ZudpsxWHoQzXgodGQGXS9lgJdXD7UzG/S5/Hn3t+MB/sT+/Fgsl 6uS7CUKtkwMJ04zvWzEjw== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox; action=sign d=eisentraut.org a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1791474254; d=eisentraut.org; mf=PHBldGVyQGVpc2VudHJhdXQub3JnPg==; rt=PHBnc3FsLWNvbW1pdHRlcnNAbGlzdHMucG9zdGdyZXNxbC5vcmc+; s=fm1:rsa-sha256:hRb7i4EtlZeOTWDo9je59BujSG4BP8t80QTV/+TZeUtVVqQ UoatqGC0DuRriJF1qZcA92be71kdzVdj24nJNMFtmSJV9x0ZBu2pEswi7OAGa6YE 0YxsnJhJQiF+ANwLUpP1EhenuRYvfgsvv8Crv8Ph/C92m7hDowiQ2qaYkPJybirD F3nJy5HVHGjnkUJsq3kJyHbllUjMcYXhQrQHpE6jO2P30mRFUBGmz8t0RYv1z66v 1yJMYkVElCpP0OCxZk/mK5IzzyLQTlV7FvU/h3hrTI5P9cyRf0b/01AeKMolOAUJ aLCAmOjDKIopw6zcXQss+Cv2Qsn3uew0sNald8A==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox; action=mi-m=1; hc=14; hn=cc,content-language,content-transfer-encoding,content-type, date,feedback-id,from,in-reply-to,message-id,mime-version, references,subject,to,user-agent; Message-Instance: m=1; h=sha256:c3B3OCUca+lW1EIjocQwLQzNZw+z4CyyjvjC5i510iM=:6cmmiz346Dx6LqxggSTZFGk3jE2tPT3gaQW8OFwUMY0=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFqDecIZ/rw6bJo7PQ09Rud38bXhxCrP4kMdMbO5aPhtiv9pM/2tnb0fKgF98uHON K2EkAnnMIXbJI86QxkmcFuYYUB7BWdQ/GbvsXFNKACiSktyUB29TzDABimV3DB4/3tbqpR n1R1dHaQheXbtNPYOW0UGgQ/ePlEUK+2Hnq4O+fIEkVcXXv2lKhF5PSw5+abDFWlaeCsQa VSPFhHzo/3S9OZBiI0eND+MJ5TZkPisDy+3BpWdwOl0FmJoVw/BAYqZlijVqZIrAef8gsT Y07e0s3mR1fG8MOxKkEDAnq6D97eMTK1p/gtH3pMJXRkXKWnZxCuJmXYc4gHZpuOsic6Ii vmtVdr7RcQCD80J3KURvkvEYaL/anNIHETKHrRdkQGbTlnS0WaRDy+d7ONtRuhtDdvJgv1 kK+E9EtO6qRVOqAk1L7h0TTSliZakzdPJsfDq+wdvTFFu8rj8XfGTkkertUgi+88FxjJ7L 7YM9+xr84pWh22r/Aa3v7mDQSzqTVfWXYbcAVenvfNkg1f00f/bJaY9bHfccHG5EeOGMV+ hdjK0o5WRk4rsqwHoDY+v7rUSkTVRFRCrVlzXW6yXvhsMEwntRLKauZnF18QRLITi9Nh8c iqoChVTXFxtuOvz3o1clbOw+icgy0RJZ8rLg9fD9/5u3/3SJs1Q0KxXFk02w X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Oct 2026 11:44:13 -0400 (EDT) Message-ID: Date: Thu, 8 Oct 2026 17:44:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: Optimize tuple deformation To: David Rowley Cc: pgsql-committers@lists.postgresql.org References: <10cee1a3-3e27-4a27-83aa-acecb757640e@eisentraut.org> Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 07.10.26 10:54, David Rowley wrote: > On Wed, 7 Oct 2026 at 19:31, Peter Eisentraut wrote: >> >> On 15.03.26 23:50, David Rowley wrote: >>> Optimize tuple deformation >> >> This commit c456e391138 changed in slot_deform_heap_tuple() the type of >> attnum from int to size_t, which seems unusual and doesn't fit with the >> surrounding code. Could you check whether that was intentional? > > It was done to work around a problem with gcc where it was refusing to > index the CompactAttribute array by adding 8 to the previous address > to get the address of the next element. Instead, it was doing LEA on > each loop, which was slower due to shift and add rather than just add. > The best I could figure out is that gcc didn't want to optimise to use > LEA due to concerns about the integer wrapping around, which, if it > did, would be a different address than doing 2^31 adds on a 64-bit > pointer. Oh! :-/ How about a really big comment about that, and maybe change the type from size_t to uint64 (or maybe uintptr_t, if it's supposed to vary on 32-bit platforms), so it looks more intentional and not like a mistake?