Re: old_snapshot_threshold vs indexes - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: old_snapshot_threshold vs indexes
Date
Msg-id CA+hUKGKeEwXBF3Uik4V3-wYyH8UEFQbaLkDkuXoiSaZaMB+5Dw@mail.gmail.com
Whole thread Raw
In response to Re: old_snapshot_threshold vs indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: old_snapshot_threshold vs indexes
List pgsql-hackers
On Tue, Aug 27, 2019 at 10:59 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > At first glance it seems
> > like we need to capture PageGetLSN(page) while we have the lock, and
> > then later pass that into TestForOldSnapshot() instead of the page.
> > I'll look into that and write a patch, probably in a day or two.
>
> Hm, but surely we need to do other things to the page besides
> TestForOldSnapshot?  I was imagining that we'd collect the
> RelationHasUnloggedIndex flag (or perhaps better, the
> RelationAllowsEarlyPruning result) before attempting to lock
> the page, and then pass it to TestForOldSnapshot.

OK I started writing a patch and realised there were a few ugly
problems that I was about to report here... but now I wonder if, based
on the comment for RelationHasUnloggedIndex(), we shouldn't just nuke
all this code.  We don't actually support unlogged indexes on
permanent tables (there is no syntax to create them, and
RelationHasUnloggedIndex() will never return true in practice because
RelationNeedsWAL() will always return false first).  This is a locking
protocol violation and a performance pessimisation in support of a
feature we don't have.  If we add support for that in some future
release, we can figure out how to do it properly then, no?

-- 
Thomas Munro
https://enterprisedb.com



pgsql-hackers by date:

Previous
From: Arcadiy Ivanov
Date:
Subject: Re: IoT/sensor data and B-Tree page splits
Next
From: Peter Geoghegan
Date:
Subject: Re: IoT/sensor data and B-Tree page splits