Re: Expanding HOT updates for expression and partial indexes - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Expanding HOT updates for expression and partial indexes
Date
Msg-id c435d703af02097ec19680c2f8d4479292a3d176.camel@j-davis.com
Whole thread Raw
In response to Re: Expanding HOT updates for expression and partial indexes  ("Greg Burd" <greg@burd.me>)
Responses Re: Expanding HOT updates for expression and partial indexes
List pgsql-hackers
On Mon, 2026-02-23 at 14:23 -0500, Greg Burd wrote:
> Hello.
>
> Attached is a new patch set that fixes a few issues identified in the
> last set.
>
> 0001 - creates a new way to identify the set of attributes both
> modified by the update and referenced by one or more indexes on the
> target relation being updated.  This patch keeps the
> HeapDetermineColumnsInfo() path within heap_update() for calls from
> simple_heap_update() when modified_attrs_valid is set to false.  I'm
> not a huge fan of this, but it does serve as a way to illustrate a
> minimal set of changes easing review a bit.
>
> 0002 - splits out the top portion of heap_update() into both
> heapam_tuple_update() and simple_heap_update(), adds a few helper
> functions and tries to reduce repeated code.  The goal here was to
> remove some of the mess related to the various bitmaps used to make
> decisions during the update.

IIUC, a minimal version of this patch set might be:

* add 'mix_attrs' bitmap to API for table_tuple_update
* have executor calculate the bitmap, using the old slot to see if
expression results have changed
* have simple_heap_update calculate the bitmap using heap_fetch to get
the old tuple (would be a redundant pin, but not sure if that's a
problem or not)

And leave the rest mostly unchanged.

Did I miss something? If not, it would be nice to see such a minimal
patch and/or understand why we don't follow that approach.

Regards,
    Jeff Davis




pgsql-hackers by date:

Previous
From: "Joel Jacobson"
Date:
Subject: Re: [BUG?] estimate_hash_bucket_stats uses wrong ndistinct for avgfreq
Next
From: "Euler Taveira"
Date:
Subject: Re: [PATCH] Add pg_get_database_ddl() function to reconstruct CREATE DATABASE statement