Re: spinlock contention - Mailing list pgsql-hackers

From Greg Stark
Subject Re: spinlock contention
Date
Msg-id BANLkTinq-yuHQwu2kTG_2fguOf2A-UJ32Q@mail.gmail.com
Whole thread Raw
In response to spinlock contention  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: spinlock contention
List pgsql-hackers
On Thu, Jun 23, 2011 at 4:42 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> ProcArrayLock looks like a tougher nut to crack - there's simply no
> way, with the system we have right now, that you can take a snapshot
> without locking the list of running processes.  I'm not sure what to
> do about that, but we're probably going to have to come up with
> something, because it seems clear that once we eliminate the lock
> manager LWLock contention, this is a major bottleneck.

Well as Tom observed earlier the kernel of a snapshot is actually a
LSN. A snapshot contains a set of xids which all committed before some
LSN and none which committed after it.

So if we had a record of what log sequence number the commit record
for any given transaction is we could build the snapshot at our
leisure without any exclusive lock. In fact we could even build it
lazily as a kind of cache only when we actually are interested in a
given xid.





--
greg


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Range Types, constructors, and the type system
Next
From: Greg Stark
Date:
Subject: Word-smithing doc changes