Re: Proposal for CSN based snapshots - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Proposal for CSN based snapshots
Date
Msg-id 5371D7DA.3010902@vmware.com
Whole thread Raw
In response to Re: Proposal for CSN based snapshots  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: Proposal for CSN based snapshots  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On 05/13/2014 09:44 AM, Amit Kapila wrote:
> On Mon, May 12, 2014 at 7:26 PM, Heikki Linnakangas
> <hlinnakangas@vmware.com> wrote:
>> In theory, we could use a snapshot LSN as the cutoff-point for
>> HeapTupleSatisfiesVisibility(). Maybe it's just because this is new, but
>> that makes me feel uneasy.
>
> To accomplish this won't XID-CSN map table be required and how will
> it be maintained (means when to clear and add a entry to that map table)?

Not sure I understand. The clog is a mapping from XID to CSN. What 
vacuum needs to know is whether the xmin and/or xmax is visible to 
everyone (and whether they committed or aborted). To determine that, it 
needs the oldest still active snapshot LSN. That can be found by 
scanning the proc array. It's pretty much the same as a regular MVCC 
visibility check, but using the oldest still-active snapshot.

- Heikki



pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: Updating config.guess/config.sub for ppc64le
Next
From: Heikki Linnakangas
Date:
Subject: Re: Proposal for CSN based snapshots