Re: Removing freelist (was Re: Should I implement DROP INDEX CONCURRENTLY?)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jim Nasby <jim(at)nasby(dot)net>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Daniel Farina <daniel(at)heroku(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Removing freelist (was Re: Should I implement DROP INDEX CONCURRENTLY?)
Date: 2012-01-23 16:03:28
Message-ID: CA+TgmobeGYzbNpvf3gwyHM7Onhh75Pw6D8kUYKPjpMViSXsN=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 23, 2012 at 11:01 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Mon, Jan 23, 2012 at 12:12 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>> The expensive part of what
>>>> we do while holding BufFreelistLock is, I think, iterating through
>>>> buffers taking and releasing a spinlock on each one (!).
>
>>> Yeah ... spinlocks that, by definition, will be uncontested.
>
>> What makes you think that they are uncontested?
>
> Ah, never mind.  I was thinking that we'd only be touching buffers that
> were *on* the freelist, but of course this is incorrect.  The real
> problem there is that BufFreelistLock is also used to protect the
> clock sweep pointer.  I think basically we gotta find a way to allow
> multiple backends to run clock sweeps concurrently.  Or else fix
> things so that the freelist never (well, hardly ever) runs dry.

I'd come to the same conclusion myself. :-)

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2012-01-23 16:15:52 Re: Re: Add minor version to v3 protocol to allow changes without breaking backwards compatibility
Previous Message Tom Lane 2012-01-23 16:01:52 Re: Removing freelist (was Re: Should I implement DROP INDEX CONCURRENTLY?)