Re: Extent Locks - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: Extent Locks
Date
Msg-id 51A44062.6080809@2ndquadrant.com
Whole thread Raw
In response to Re: Extent Locks  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Extent Locks  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
On 05/17/2013 11:38 AM, Robert Haas wrote:
> maybe with a bit of modest pre-extension.
When it comes to pre-extension, is it realistic to get a count of
backends waiting on the lock and extend the relation by (say) 2x the
number of waiting backends?

Getting a list of lock waiters is always a racey proposition, but in
this case we don't need an accurate count, only an estimate, and the
count can only grow between getting the count and completing the
relation extension. Assuming it's even remotely feasible to get a count
of lock waiters at all.

If there are lots of procs waiting to extend the relation a fair chunk
could be preallocated with posix_fallocate on supported platforms.

If it's possible this would avoid the need to attempt any
recency-of-last-extension based preallocation with the associated
problem of how to store and access the last-extended time efficiently,
while still hopefully reducing contention on the relation extension lock
and without delaying the backend doing the extension too much more.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services




pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: commit fest schedule for 9.4
Next
From: Craig Ringer
Date:
Subject: Re: Extent Locks