Re: Expanding HOT updates for expression and partial indexes

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Greg Burd <greg(at)burd(dot)me>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Expanding HOT updates for expression and partial indexes
Date: 2026-02-25 21:03:01
Message-ID: c435d703af02097ec19680c2f8d4479292a3d176.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2026-02-25 21:19:27 Re: [PATCH] Add pg_get_database_ddl() function to reconstruct CREATE DATABASE statement
Previous Message Joel Jacobson 2026-02-25 20:31:57 Re: [BUG?] estimate_hash_bucket_stats uses wrong ndistinct for avgfreq