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 1xENQO-000000014Vb-2KSj for pgsql-committers@arkaria.postgresql.org; Wed, 07 Oct 2026 08:54:56 +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 1xENQN-00000005ZHx-1yVD for pgsql-committers@arkaria.postgresql.org; Wed, 07 Oct 2026 08:54:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xENQN-00000005ZHo-0N1T for pgsql-committers@lists.postgresql.org; Wed, 07 Oct 2026 08:54:55 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xENQK-00000000rNN-2UOY for pgsql-committers@lists.postgresql.org; Wed, 07 Oct 2026 08:54:54 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-48c45111bebso1066587f8f.0 for ; Wed, 07 Oct 2026 01:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1791363290; cv=none; d=google.com; s=arc-20260327; b=bdHeDbJ9KWAHUjGV1RPkKiYOCleuig6g5ND9rK019xmNnN6euX2t16f/6BGAB/HwA4 le+suYeiLU2dVdQeZrpQESIyDtQ3BT+6XLzpJibYgzpbOiYECAgqm3/gc0mblH4FbNP0 u1P7zzrh9bO1i4oTHTBIxv0YD2KZc0TGck5bVjB/V6na4k53pQzZPcE54wyGr1Gkqo5U GprB6FRg+CUSiFUkWuLlbTn4vbs9hJTfaGzIDU/LauGc4TDXB7tD+e9zjpmW387yYMH9 oIo+rsmrhfOxQAAS0PuEA6AqKoZoSVGaY4INqVXfNPLAT0ce5FdIrbC3dKKxqwbGVJYh vFeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=9uCfGzQTt0W+iDCMYhkefqqM59zDXHEi4OHu4aMhxUw=; fh=AgL3lFm2LgQk+7p8Bk+0D/dn844rhrHysGyp1rO5O8c=; b=gIahf3GZoXBX20CU9cO+DGiesPomikzM1HzmpGmFWJq38YlPqvJsNP1LgPdFepkkN1 veZsraxin63y+7LVdKaQJeRT4R97QrDzT3CbJ67bDRC68+nWTiq8EUOKsbJqKU/o2j8S bkQHPuaXdUO67PevComd4Gc8dXDd7VjLdYnPuaDC/+dyDQJ5sLqbF3eF8xIDN9ZuFuL5 OnR3j97DofXIoSQjLqsS3sBK+y9nHCP3DaDVyLcA9oLM4h9Jc6a5NVbiVskyIANSTKtP fdOV+uJbHG1/JIzgZ2UkE8YQzqRWLL5L31BM/JWjYrqadNaXCkp/yw4b1ZdLhgtoZFbZ DM9g==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791363290; x=1791968090; darn=lists.postgresql.org; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9uCfGzQTt0W+iDCMYhkefqqM59zDXHEi4OHu4aMhxUw=; b=qpdHyXVrt3KOw/09cKaZ6jDyEA966kbsvwa/VQoc2RqYmOSLfYucSVXIZ34icBgArx JJn19b4R0yep+pYzeB5SePHHd5bMtrt+y0DPUeAk6QoFqrsrDx7jKUZg/hTbtzRP7smY zcUSy/7kcT0nXTOurqtE2Foxd1p9GBWHi/8EhYbu+Mow5qW7oRGSd89UPQwHaoKktiAn SrZEOvk6BCrBuyT+P8T1tZFaaZOBGwb5EMI79QCyeZLfaDxmFzil6X1ZJmHNMPHcQHpr t3j6WLkNMFIALMpbO7nZWeYmybZrriSV2uB5QcpKrEIRJdHyvGK83D3vHYUrgl2LJEvb IP+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791363290; x=1791968090; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=9uCfGzQTt0W+iDCMYhkefqqM59zDXHEi4OHu4aMhxUw=; b=jir3NQHmcybmkdoVkSd09qljy6sYCl3AlR/V93x10pbGCiEjUEErAhKb+50tggMI5o nDH7SbiKkEbwR0/skEAB7S/GzXZuPBWvDrKQO0YDi81uukjBNMlJa2dlDjC8T6WLXkWn bo/yEM1r/TR6S+Qd0DLvW17McAATQl9SV544Vh6Nq56kYF5A5N3M8Ez63977idg0SjzI o+F9BXptNlqsKF3H1hijszAzDdMPGjzl4+5Znl3Bd4G+enAJwgpeA1M7vMAyrfab54cT J/2LECKCWQ7VZSgil5i4ypvkY7u+A1RmTsGxGTMTFugV/cl2Pegug4TYFUzznt3I5SJD EeHg== X-Forwarded-Encrypted: i=1; AKwUvBy9Hs5YmI5SV4cgg+JcnS8dABIZwtU7dW+dr0ZVmDTLb2mmX8i/3HdaBbbJPWjWuGfWKWe6cp+TQHJ3+IzTDUdq@lists.postgresql.org X-Gm-Message-State: AFq9FYJJyN3mCI9E/6X9QrLRvkCbhDB9gitf3zR9X6A4FiQ6pj8IBlZi LDL8SkboLdks9OxB5rHFpSvXyMX0sgQU3DxAMXyYbXFNZ8djsSK8+Yl4XWAlmipzTMGOmN293+2 BVw/HBfLp70FYt0ifkZRs1kxrhKhtaUeZXU98 X-Gm-Gg: AYBFou0TP0uGtaZ1edjRz8FR8/7cgykCjhtrYq8EHdkek2PEV1yVK+eWs+NyHC/l86R YkgEM/0ExFaDh3OYX49b5fFOIKPb3cEMKPuED1+0SVUqeHRCKJKfUvNsV9KljtOq6M682GIZ8bk kzKDVI9o4a71rnWrZLPP1JMCu0q6GDG9YSHaP9QH2hLHQfgCX69iml2B/ytLQgO6xv2JQsVRzNa za6xIRmtTvxGMVRPFitNaizPp9KruwGw5Quqh4CJjY7KmWH5bItAbd9IVtmwjTFCJ08JnsaW53j yvno9nfjYS+iEl8YD40jC1rBWGntLYNIaj4iZa1ijWdMXHCd2v31JNasULFQgUMsIaBN+VjMQX0 09PaLxAWEv8bjfsZB/LdAIxoyEztrFk1nl+GCwTeiHbZCjmE= X-Received: by 2002:a05:6000:1788:b0:48b:e54:84a1 with SMTP id ffacd0b85a97d-48c7288b88bmr3059616f8f.55.1791363290082; Wed, 07 Oct 2026 01:54:50 -0700 (PDT) MIME-Version: 1.0 References: <10cee1a3-3e27-4a27-83aa-acecb757640e@eisentraut.org> In-Reply-To: <10cee1a3-3e27-4a27-83aa-acecb757640e@eisentraut.org> From: David Rowley Date: Wed, 7 Oct 2026 21:54:39 +1300 X-Gm-Features: AclHuK9DrkWn-vgbaQkRfaSE4al9t_ekEFy7K_Ou03uWWjAaAnPIE7RWgHJNurg Message-ID: Subject: Re: pgsql: Optimize tuple deformation To: Peter Eisentraut Cc: David Rowley , pgsql-committers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. David