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

Not HOT enough

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Not HOT enough
Date: 2011-11-22 20:23:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Some time ago, I changed GetOldestXmin() to ignore procs in other
databases resulting in a potentially later xmin.

GetSnapshotData() was not touched when that happened, even though the
comments say "...This is the same computation done by
GetOldestXmin(true, true)." The transam/README file says it stronger
"GetSnapshotData also performs an oldest-xmin calculation (which had
match GetOldestXmin's)". Doh.

As a result, VACUUM ignores procs in other databases, whereas HOT does
not. That means we aren't cleaning up as much as we could do when
running multiple databases. If its OK for VACUUM, then it must be OK
for HOT cleanup also.

Attached patch ignores procs in other databases during
GetSnapshotData() when IsMVCCSnapshot(), using similar coding to

Any doubters?

I suggest this is backpatched a few releases.

 Simon Riggs         
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment: fix_getsnapshotdata.v1.patch
Description: application/octet-stream (1011 bytes)


pgsql-hackers by date

Next:From: Bruce MomjianDate: 2011-11-22 20:42:35
Subject: Re: pg_upgrade relation OID mismatches
Previous:From: Peter EisentrautDate: 2011-11-22 20:02:07
Subject: pg_upgrade relation OID mismatches

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