Re: Expanding HOT updates for expression and partial indexes

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Greg Burd <greg(at)burd(dot)me>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Expanding HOT updates for expression and partial indexes
Date: 2026-03-24 19:44:38
Message-ID: acLppkl4hutHhiuH@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 24, 2026 at 02:02:07PM -0400, Greg Burd wrote:
> On Mon, Mar 23, 2026, at 2:39 PM, Nathan Bossart wrote:
>> On Tue, Mar 17, 2026 at 02:04:11PM -0400, Greg Burd wrote:
>>> - * INDEX_ATTR_BITMAP_SUMMARIZED Columns included in summarizing indexes
>>> + * INDEX_ATTR_BITMAP_INDEXED Columns referenced by indexes
>>> + * INDEX_ATTR_BITMAP_SUMMARIZED Columns only included in summarizing indexes
>>
>>> - Bitmapset *summarizedattrs; /* columns with summarizing indexes */
>>> + Bitmapset *indexedattrs; /* columns referenced by indexes */
>>> + Bitmapset *summarizedattrs; /* columns only in summarizing indexes */
>>
>> As before, the comment changes for the summarized-attr-related stuff seem
>> unnecessary.
>
> I disagree, the "only" is required to highlight the logic change here.
> Before this patch summarized attrs could overlap with indexed attrs, now
> it should not. This makes the logic a bit easier later in
> HeapUpdateHotAllowable().

My bad, you are right.

> So, we go from 3 calls to RelationGetIndexAttrBitmap() to 1, or at most 2
> when there's a summarizing index (which is frequently the case).
>
> This feels more logical, cleaner, and has less overhead but supports the
> same HOT logic.

Nice.

--
nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-03-24 20:09:37 Re: Adding locks statistics
Previous Message Masahiko Sawada 2026-03-24 19:09:13 Re: pg_buffercache: Add per-relation summary stats