Re: Not HOT enough - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Not HOT enough
Date
Msg-id 760.1322073018@sss.pgh.pa.us
Whole thread Raw
In response to Re: Not HOT enough  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Not HOT enough
List pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> On Tue, Nov 22, 2011 at 11:40 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
>>> I think this is unsafe for shared catalogs.

>> I think so too. Thats why it uses IsMVCCSnapshot() to confirm when it
>> is safe to do so.

> Ah, you mean access to shared catalogs using MVCC snapshots.

[ having now read the patch a bit more carefully ]

I think the fundamental problem with this is that it's conflating "what
to do in shared catalogs" with "what to do when an MVCC snapshot is
being used".  HOT cleanup activity really ought not have anything at all
to do with what snapshot is being used to scan the page.

I'm also extremely uncomfortable with the fact that your proposed coding
changes not only the RecentGlobalXmin output of GetSnapshotData, but the
actual snapshot output --- you have not even made an argument why that
is safe, and I doubt that it is.

What I think might make more sense is to keep two variables,
RecentGlobalXmin with its current meaning and RecentDatabaseWideXmin
which considers only xmins of transactions in the current database.
Then HOT cleanup could select the appropriate cutoff depending on
whether it's working on a shared or non-shared relation.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Not HOT enough
Next
From: Jan Urbański
Date:
Subject: Re: plpython SPI cursors