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

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Jim Nasby <jim(at)nasby(dot)net>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-24 14:49:14
Message-ID: CAMkU=1xpfQRcFPx3x++KVxQ7FQO=6MYERPS22Fh5ekJztmfytA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 21, 2012 at 2:29 PM, Jim Nasby <jim(at)nasby(dot)net> wrote:
> On Jan 20, 2012, at 11:54 AM, Heikki Linnakangas wrote:

>> So, you're proposing that we remove freelist altogether? Sounds reasonable, but that needs to be performance tested somehow. I'm not sure what exactly the test should look like, but it probably should involve an OLTP workload, and large tables being created, populated to fill the cache with pages from the table, and dropped, while the OLTP workload is running. I'd imagine that the worst case scenario looks something like that.
>
> We should also look at having the freelist do something useful, instead of just dropping it completely. Unfortunately that's probably more work...

If the head and tail are both protected by BufFreelistLock, I'm pretty
sure this will make things worse, not better.

If we change to having head and tail protected by separate spinlocks,
then I don't see how you can remove the last buffer from the list, or
add a buffer to an empty list, without causing havoc.

Does anyone have ideas for implementing a cross-platform, lock-free,
FIFO linked list? Without that, I don't see how we are going to get
anywhere on this approach.

Cheers,

Jeff

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2012-01-24 14:49:29 Re: Page Checksums
Previous Message Robert Haas 2012-01-24 14:39:08 Re: Inline Extension