Re: Potential problem with HOT and indexes? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Potential problem with HOT and indexes?
Date
Msg-id 25965.1238096507@sss.pgh.pa.us
Whole thread Raw
In response to Re: Potential problem with HOT and indexes?  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Potential problem with HOT and indexes?  (Greg Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
>> Another thought now though. What if someone updates the pg_index entry --
>> since we never reset indcheckxmin then the new tuple will have a new xmin and
>> will suddenly become invisible again for no reason.

> Fixing this for REINDEX is fairly straightforward I think. It already updates
> the pg_index line to fix indisvalid and indisready. see:

I realized what was bothering me about that patch: it could reset
indcheckxmin too soon, ie, while there are still transactions that
shouldn't use the index.

I propose that we modify it slightly: if we are updating a pg_index
row, and indcheckxmin is set, *and the old xmin is below the GlobalXmin
horizon*, then reset indcheckxmin.  Otherwise leave it set, which will
mean that we postpone the time when the index becomes usable to
everyone, but it won't risk breaking anything.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: maintenance_work_mem and autovacuum
Next
From: Greg Stark
Date:
Subject: Re: Potential problem with HOT and indexes?