Skip site navigation (1) Skip section navigation (2)

Re: Not HOT enough

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Not HOT enough
Date: 2011-11-23 18:30:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> On Tue, Nov 22, 2011 at 11:40 PM, Simon Riggs <simon(at)2ndquadrant(dot)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

In response to


pgsql-hackers by date

Next:From: Jan UrbaƄskiDate: 2011-11-23 18:58:55
Subject: Re: plpython SPI cursors
Previous:From: Tom LaneDate: 2011-11-23 18:15:58
Subject: Re: Not HOT enough

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group