Re: Performance under contention - Mailing list pgsql-performance

From Ivan Voras
Subject Re: Performance under contention
Date
Msg-id AANLkTikGONfBBNY3DwH_8LLjNc3J+y2WunU4m6+O-J1T@mail.gmail.com
Whole thread Raw
In response to Re: Performance under contention  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-performance
On 7 December 2010 19:10, Robert Haas <robertmhaas@gmail.com> wrote:

>> I'm not very familiar with PostgreSQL code but if we're
>> brainstorming... if you're only trying to protect against a small
>> number of expensive operations (like DROP, etc.) that don't really
>> happen often, wouldn't an atomic reference counter be good enough for
>> the purpose (e.g. the expensive operations would spin-wait until the
>> counter is 0)?
>
> No, because (1) busy-waiting is only suitable for locks that will only
> be held for a short time, and an AccessShareLock on a table might be
> held while we read 10GB of data in from disk,

Generally yes, but a variant with adaptive sleeping could possibly be
used if it would be acceptable to delay (uncertainly) the already
expensive and rare operations.

> and (2) that wouldn't
> allow for deadlock detection.

Probably :)

pgsql-performance by date:

Previous
From: Andres Freund
Date:
Subject: Re: Compared MS SQL 2000 to Postgresql 9.0 on Windows
Next
From: Craig James
Date:
Subject: Re: Compared MS SQL 2000 to Postgresql 9.0 on Windows