Re: [PATCH] Don't block HOT update by BRIN index

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Josef Šimánek <josef(dot)simanek(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Don't block HOT update by BRIN index
Date: 2021-07-12 20:45:24
Message-ID: 4a8c86eb-d570-ec78-b9af-66f218fae820@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 7/12/21 10:37 PM, Alvaro Herrera wrote:
> On 2021-Jul-12, Tomas Vondra wrote:
>
>> 2) Do we actually need to calculate and store hotblockingattrs
>> separately in RelationGetIndexAttrBitmap? It seems to me it's either
>> NULL (with amhotblocking=false) or equal to indexattrs. So why not to
>> just get rid of hotblockingattr and rd_hotblockingattr, and do something
>> like
>>
>> case INDEX_ATTR_BITMAP_HOT_BLOCKING:
>> return (amhotblocking) ? bms_copy(rel->rd_hotblockingattr) : NULL;
>>
>> I haven't tried, so maybe I'm missing something?
>
> ... What? I thought the whole point is that BRIN indexes do not cause
> the columns to become part of this set, while all other index types do.
> If you make them both the same, then there's no point.
>

Well, one of us is confused and it might be me ;-)

The point is that BRIN is the only index type with amhotblocking=false,
so it would return NULL (and thus it does not block HOT). All other
indexes AMs have amblocking=true and so should return rd_indexattr (I
forgot to change that in the code chunk).

regards

--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josef Šimánek 2021-07-12 20:45:30 Re: [PATCH] Don't block HOT update by BRIN index
Previous Message Thomas Munro 2021-07-12 20:44:53 Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.