Re: Performance under contention

From: Ivan Voras <ivoras(at)freebsd(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Jignesh Shah <jkshah(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance under contention
Date: 2010-12-07 18:21:13
Message-ID: AANLkTikGONfBBNY3DwH_8LLjNc3J+y2WunU4m6+O-J1T@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 7 December 2010 19:10, Robert Haas <robertmhaas(at)gmail(dot)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 :)

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Craig James 2010-12-07 19:23:24 Re: Compared MS SQL 2000 to Postgresql 9.0 on Windows
Previous Message Andres Freund 2010-12-07 18:20:36 Re: Compared MS SQL 2000 to Postgresql 9.0 on Windows