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.94.2) (envelope-from ) id 1v6wIO-00CFkD-SF for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 19:27:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v6wIL-008EIc-9c for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 19:27:22 +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.94.2) (envelope-from ) id 1v6wIK-008EIU-Vy for pgsql-hackers@lists.postgresql.org; Thu, 09 Oct 2025 19:27:21 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v6wIJ-001HxH-1h for pgsql-hackers@postgresql.org; Thu, 09 Oct 2025 19:27:21 +0000 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-3304a57d842so1193357a91.3 for ; Thu, 09 Oct 2025 12:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1760038037; x=1760642837; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=Xwr/kGZhIbkp5b9HcNnzOVw8nsGK7U9lTM+Fdb/f2SQ=; b=zxtkJ70ZjgkzNFVj6qcWvoTdcDKeJnVSex8ZqsDTZfzn4ryoqyg37/I7li1tGATizK uMAC7AzYNmptQ4r1IKD98zN7PqehjLEkGNSVeA6UkinxZQUchVLMluNhaeLKr+l7TQ97 x94LdGfmxoYmaFcmfkdDc3gubHP+AlZ9pU11PjSHmAiIy4kEk4yPingSwXWlKeWQh4d9 G/Bv3yXkSWpQrw4R3Mh2By7r8mFauBFhdE8F7hbkqJJdPlWs2b4ovi3adIMuCuLg1a8/ MqVImE4GqHPGpjx9hjr5ozPzYtgPgT1brf5RJV171gV4yc4HY8TCUzu+iUHs3wBDWMyg nJsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760038037; x=1760642837; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Xwr/kGZhIbkp5b9HcNnzOVw8nsGK7U9lTM+Fdb/f2SQ=; b=YWW8iDk82RchW5CPGcI+VMm8NZ4JCeEk4X0Xl2q5N56bghWS5HFueEGKKoDZe/49VG F41Xj0UtA2SKD+WvBmJzOnp3wYUx9ZyGc7PEDRybyjN6IQvZwg68CF8Hpx9wwSennQxK 26x7XSNtM/BYpVEw8W+ccWZda258ok5+oe5Hqot3fgYrna1kb9BrW4ZVGpHVBCRpjJZ0 +yYZXxy3odHY70YY1SfsNlO9nJRiL2b0vRONAXxcuRCK/Mdnt6SR3yGR9D2hXYPykyOB 1TVfpK6IPcSqxY9zdZhjtYJodZIwsvAuF8dEvhuFVeYQzPMbjhUMBqQhMd5deXjT4dwN /i+w== X-Gm-Message-State: AOJu0YxhnHJD74RRxrQjmFm7I7XQc1vgt11HLmEbxjNFIyUHp3qyZtot GBgpJXHQ9u50j4UPHhjUhpU9GfilwcOvJPqmS3b9oRiPgTl3JMnXc/jyQ7K55zAeEw== X-Gm-Gg: ASbGncupZQZLlIHjfJ/oIfG8//mLzYM/C40LfoBLiyQNMTEHNQPmuvKEZQdtcFkM4MW cHdlL8qWKglZy1Ua3slAMIfR7O5ma+IqXVQJ7Abz2C6W41kdAjRbqvrbJtKhAWnehX+A6sxvA4c 9J9P0LgGZLJkMc/l4vGR0dE4IhMPQxW7OsmICtQp/Oj0HzEFlBIwhjh5sOx2CTtlyr58O1yvqQR xsgHOtc7Idg0MYFv1Wi/tG8MJfHCV8FNIqC6hqFRx+iLssS/LXf7OA89uEPgfOvWow9kbu3814N 5y9WT03vuMTNWDJXUzvUqANzMQB/4/omgwLBX7RyU3J0V+ym9P5ct6ho+R74aRcIt031IaQ1AEh vYJ6qIY2A7Fjy7gHzyT8PcbGkZh99Ldu+sMqB9e41C0s1lGrBILrOlw6qyzIajCno6iJgR4B04N FNaFOJf2xdnkD+nQHDOATDdhxs X-Google-Smtp-Source: AGHT+IFA4498rHlN8WME9AcQ58LaKxqoszEqHVo4WrkOed5rz54hIc+ATVqTrL3AO76TwCqid3q8Fw== X-Received: by 2002:a17:90b:3e88:b0:336:b604:78be with SMTP id 98e67ed59e1d1-33b513cd7b8mr11656846a91.25.1760038037082; Thu, 09 Oct 2025 12:27:17 -0700 (PDT) Received: from jeff-ws-bridge.lan (c-24-7-19-3.hsd1.ca.comcast.net. [24.7.19.3]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b678df47919sm388896a12.27.2025.10.09.12.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Oct 2025 12:27:16 -0700 (PDT) Message-ID: Subject: Re: Expanding HOT updates for expression and partial indexes From: Jeff Davis To: Greg Burd , "Burd, Greg" Cc: "pgsql-hackers@postgresql.org" Date: Thu, 09 Oct 2025 12:27:15 -0700 In-Reply-To: References: <97f0aa72-f172-4673-8b04-533f022c3149@app.fastmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2025-10-07 at 17:36 -0400, Greg Burd wrote: > After reviewing how updates work in the executor, I discovered that > during execution the new tuple slot is populated with the information > from ExecBuildUpdateProjection() and the old tuple, but that most > importantly for this use case that function created a bitmap of the > modified columns (the columns specified in the update).=C2=A0 This bitmap > isn't the same as the one produced by HeapDetermineColumnsInfo() as > the > latter excludes attributes that are not changed after testing > equality > with the helper function heap_attr_equals() where as the former will > include attributes that appear in the update but are the same value > as > before.=C2=A0 This, happily, is immaterial for the purposes of my functio= n > ExecExprIndexesRequireUpdates() which simply needs to check to see if > index tuples generated are unchanged.=C2=A0 So I had all I needed to run > the > checks ahead of acquiring the lock on the buffer. You're still calling ExecExprIndexesRequireUpdates() from within heap_update(). Can't you do that inside of ExecUpdatePrologue() or thereabouts? Regards, Jeff Davis