On Mon, Aug 22, 2011 at 10:25 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> I've been giving this quite a bit more thought, and have decided to
> abandon the scheme described above, at least for now.
I liked your goal of O(1) snapshots and think you should go for that.
I didn't realise you were still working on this, and had some thoughts
at the weekend which I recorded just now. Different tack entirely.
> Heikki has made the suggestion a few times (and a few other people
> have since made somewhat similar suggestions in different words) of
> keeping an-up-to-date snapshot in shared memory such that transactions
> that need a snapshot can simply copy it. I've since noted that in Hot
> Standby mode, that's more or less what the KnownAssignedXids stuff
> already does. I objected that, first, the overhead of updating the
> snapshot for every commit would be too great, and second, it didn't
> seem to do a whole lot to reduce the size of the critical section, and
> therefore probably wouldn't improve performance that much. But I'm
> coming around to the view that these might be solvable problems rather
> than reasons to give up on the idea altogether.
Sounds easy enough to just link up KnownAssignedXids and see...
--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services