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.96) (envelope-from ) id 1vrLUm-00GEIx-38 for pgsql-hackers@arkaria.postgresql.org; Sat, 14 Feb 2026 19:40:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vrLUl-0009OL-2e for pgsql-hackers@arkaria.postgresql.org; Sat, 14 Feb 2026 19:39:59 +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.96) (envelope-from ) id 1vrLUl-0009OC-1L for pgsql-hackers@lists.postgresql.org; Sat, 14 Feb 2026 19:39:59 +0000 Received: from mail-dy1-x132e.google.com ([2607:f8b0:4864:20::132e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vrLUi-00000000dSB-26Qo for pgsql-hackers@postgresql.org; Sat, 14 Feb 2026 19:39:58 +0000 Received: by mail-dy1-x132e.google.com with SMTP id 5a478bee46e88-2b785801c93so5234265eec.0 for ; Sat, 14 Feb 2026 11:39:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1771097995; x=1771702795; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=tVG3wNzfELzwQv4qQIXbNJ5EKSidFHpUVTly4FHrwdE=; b=yJtir6uXkTykI8YripXPq7j+zLow7jHr612wMiJ5/S3Rmfa2sNpYf3dOSa0uQD8skZ rXipyXmx1Aawe5YnaEWLRfwgn3h/n5UAoBGKshbGukALPhpdyAN93DNkMYCwnaIsQYtK VhcsBVk3UqsKPhxPLxC+w1fHE+47UBqIhhDkqrgTFdvyL2P9AL0v+3Y5wyOeqaSXJ+e2 QxengK7aTfZZMzGQYJjLgqEHILB0KNU5YYZoZMBqtjMl8HIhPJrzvi2fEYDxmj88eMDh pWWCjXG/KufIkd77SsDR+ETpxLAxWqni2Iaze7jNbkWqJOtdS1GVFDtN8wyrs8Am2+aG h7Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771097995; x=1771702795; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tVG3wNzfELzwQv4qQIXbNJ5EKSidFHpUVTly4FHrwdE=; b=NYg2OMyGQa4OGz1TK38NlnFS4BmQmFxHW82zJ0PPaoqowpUUDbmSjcZ/BnPbpfWEc9 x94dxeFBGFaYR4QwHzRwX47Txv+IOBkuY2+db463ywqn7i6zO+5z178d6ROSN7PnVzRc mT6BOhTBZqpOJHfu2Dwf65Bmlvtefs/FF84M3wFdW7CZrIJXpwhdbcKSwG5YNoxpV1GP e+l60zlah6nJ9xZoAC+8pbVrrZP8bWberTwxhPGzXeOr0GgduHLmygXK6+HnUrKLkoKJ vFmD470vfdlyvolsdZErKNe2yqGu41sSeW7CzjSFkSz2ZIC9Y42C17AgBhqdckcCsu5b k2SQ== X-Forwarded-Encrypted: i=1; AJvYcCXBCMM1MCYIIhO7GWWgOtqLOCrXlrgM1ikNwna7i+VLqNHnOCmf0gKhN1xv9wYHwfGrDpvJNabKbMb2E0F7@postgresql.org X-Gm-Message-State: AOJu0YzLWwZIcDYJVvApEeLBmk2fDJ6gSkcTIcEfwPyT+svXuby+XxJ/ 5xAsN++oe2dCCpUzX2SoK1AA3WbSAF+NF7OyMNTmnOQUoXFjsIE+uGvEs/odnQ6L/A== X-Gm-Gg: AZuq6aI3UFWoZSzPTHr9iALp1zA4exIoZ3Tm5hsJO2eRMuYV+FbKqork5XTd2KpJGmp xYXwfGijVxQN72Lsly5ZOD3L/rzUi/+lGB/zD3y4lvp9VMps5M1X3xuox4Jv6+qHMD43LJLVFu0 hni3Zb8gAXLCnnJYDNiQ4Tx5KPlh0XvpRj8Q/MOM7+I84Z0u5HIoc5JFW+X/2CpqCm8mALfFT/b 6maSIy3HooCCtU5LFQogswzAlGq60KIM+jo4+MNwduyWzR1/cfG+VHfXEmUjA0TVjM48Lu9ohA2 r36STzBEEzcxGd/bF2W0mbgjLzzpMqVC7AnW/7hMilqM9XfCAx/VQlf0FSPacANUF+BDzcUErbf nZY/mBymdgpXi5YJf67s4JPlIYNdGSUeNOhqIOEw4jHcS5wyxc+q4ukodh4EBxQCFS8ZdNXeNqA 5h7Ejqxx2MQA7mOcvuRKnFuOh5Z+0+3ISJLudYmLhnLNwFHE80XPg= X-Received: by 2002:a05:7301:4083:b0:2b8:6b32:1cf1 with SMTP id 5a478bee46e88-2bac97c5053mr1589463eec.29.1771097995402; Sat, 14 Feb 2026 11:39:55 -0800 (PST) Received: from jeff-laptop.lan (c-24-7-19-3.hsd1.ca.comcast.net. [24.7.19.3]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2bacb67bc16sm3287723eec.32.2026.02.14.11.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Feb 2026 11:39:54 -0800 (PST) Message-ID: <3e1b9075c92808a7356e79087ba51910e5db5a30.camel@j-davis.com> Subject: Re: Expanding HOT updates for expression and partial indexes From: Jeff Davis To: Greg Burd , pgsql-hackers Date: Sat, 14 Feb 2026 11:39:53 -0800 In-Reply-To: References: <5165C147-B476-4E3D-AAA9-11C0B966FC4D@greg.burd.me> <9394564A-5764-4DCA-8845-8AE102DE61DC@greg.burd.me> <97769442-2ed7-4fe0-a393-7e2b5ff7ff58@app.fastmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1.1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2026-02-13 at 16:06 -0500, Greg Burd wrote: > Here's my thinking, this patch set can be thought of as: >=20 > a) moving HeapDetermineColumnsInfo() into the executor This feels like the core of the series: moving the logic into the executor make it possible to be smarter about whether HOT can be applied or not. I think that is a good direction to go. I don't think HOT is fundamentally a heap concept because other AMs may do something similar and would want similar information. There are two parts to the decision of whether to use HOT: first, is there a logical change to the indexed value; and second, does the AM need to=C2=A0break the change for some other reason (e.g. the current page is full). It seems reasonable to me that the executor is the right place for the first check, because it can be more precise. The motivating example here is a JSON document where one field is indexed and unrelated fields are being updated, in which case we can still do a HOT update because the indexed value isn't actually changing. As far as the patch itself, it seems like you're moving a lot of code out of heap_update() and into simple_heap_update() & heapam_tuple_update(). Can you explain why that's needed? Perhaps I just need to look closer. > b) all that HOT nonsense >=20 > I feel that (a) has value even without (b), that removing a chunk of > work from within an exclusive buffer lock to outside that lock is a > Good Thing(TM) and could in this case result in more concurrency. Right. It would be nice to see some numbers here, but moving work outside of the buffer lock seems like a good idea. > To that end, present to you a single patch that *only* does (a), it > moves the logic of HeapDeterminColumnsInfo() into the executor and > doesn't change anything else.=C2=A0 Meaning that what goes HOT today > (without this patch), should continue to be HOT tomorrow (with this > patch) and nothing else. Why are there test diffs? Also, does this move us (slightly) closer to PHOT? Regards, Jeff Davis