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

From Jeff Davis
Subject Re: Proposal for CSN based snapshots
Date
Msg-id 1409043789.2335.330.camel@jeff-desktop
Whole thread Raw
In response to Re: Proposal for CSN based snapshots  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: Proposal for CSN based snapshots
List pgsql-hackers
On Fri, 2014-06-13 at 13:24 +0300, Heikki Linnakangas wrote:
> Attached is a new patch. It now keeps the current pg_clog unchanged, but 
> adds a new pg_csnlog besides it. pg_csnlog is more similar to 
> pg_subtrans than pg_clog: it's not WAL-logged, is reset at startup, and 
> segments older than GlobalXmin can be truncated.

It appears that this patch weakens the idea of hint bits. Even if
HEAP_XMIN_COMMITTED is set, it still needs to find out if it's in the
snapshot.

That's fast if the xid is less than snap->xmin, but otherwise it needs
to do a fetch from the csnlog, which is exactly what the hint bits are
designed to avoid. And we can't get around this, because the whole point
of this patch is to remove the xip array from the snapshot.

If the transaction was committed a long time ago, then we could set
PD_ALL_VISIBLE and the VM bit, and a scan wouldn't even look at the hint
bit. If it was committed recently, then it's probably greater than the
recentXmin. I think there's still room for a hint bit to technically be
useful, but it seems quite narrow unless I'm missing something (and a
narrowly-useful hint bit doesn't seem to be useful at all).

I'm not complaining, and I hope this is not a showstopper for this
patch, but I think it's worth discussing.

Regards,Jeff Davis





pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: Final Patch for GROUPING SETS - unrecognized node type: 347
Next
From: Fabien COELHO
Date:
Subject: Re: pgbench throttling latency limit