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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers