| From: | "Greg Burd" <greg(at)burd(dot)me> |
|---|---|
| To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Expanding HOT updates for expression and partial indexes |
| Date: | 2026-02-13 21:06:08 |
| Message-ID: | a9c8ee0d-bb60-418b-847f-49c4332a09c4@app.fastmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, Feb 10, 2026, at 10:09 AM, Greg Burd wrote:
> Hello,
>
> TL;DR, I'm going to put a pin in this idea for now.
Okay, I couldn't put the pen down after all. :)
Here's my thinking, this patch set can be thought of as:
a) moving HeapDetermineColumnsInfo() into the executor
b) all that HOT nonsense
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.
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. Meaning that what goes HOT today (without this patch), should continue to be HOT tomorrow (with this patch) and nothing else.
Catalog tuples use simple_heap_update() which calls HeapDeterminColumnsInfo() just as it does now, so these results are also identical.
Logically replicated tuples avoid HeapDeterminColumnsInfo() because the carry with them the set of changed attributes, so I surface that from within slot_modify_data() and intersect it with the set of indexed attributes resulting in an identical update while avoiding that overhead.
This has to run faster, I'll measure it ASAP and post, but I thought I'd share this now to potentially keep the ball rolling.
best.
-greg
PS: I'll layer in the additional changes in a future post that expand HOT, but those can be viewed in the context of "maybe in v20" while I hope that this patch could be potentially acceptable in v19.
| Attachment | Content-Type | Size |
|---|---|---|
| v20260211-0001-Idenfity-modified-indexed-attributes-in-th.patch | text/x-patch | 80.7 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andres Freund | 2026-02-13 21:13:39 | Re: Adding locks statistics |
| Previous Message | Paul A Jungwirth | 2026-02-13 20:00:52 | Re: SQL:2011 Application Time Update & Delete |