Re: Multiple buffer cache? - Mailing list pgsql-general

From Greg Smith
Subject Re: Multiple buffer cache?
Date
Msg-id 4B6DFB1F.90807@2ndquadrant.com
Whole thread Raw
In response to Re: Multiple buffer cache?  ("Bret S. Lambert" <bret.lambert@gmail.com>)
List pgsql-general
Bret S. Lambert wrote:
> On Sat, Feb 06, 2010 at 02:44:32PM +0100, C?dric Villemain wrote:
>
>> I am working on pgfincore which allow in some way to prepare buffer cache.
>> You need pg > 8.4 and linux (probably working with bsd too)
>>
>
> Why do something with a non-portable interface? Most OSes support
> coherently mmap(2)'ing disk blocks into memory; in fact, I'm somewhat
> taken aback that the postgres buffer cache isn't implemented in that
> manner, but I'm willing to give the devs credit for having not done
> so for good reasons.
>

First off, Cedric's work is using a fairly portable interface:  mincore
http://www.kernel.org/doc/man-pages/online/pages/man2/mincore.2.html

combined with clever bits of mmap.  Two useful introductions to this are
are http://www.usenix.org/events/lisa07/tech/plonka.html and
http://www.kennygorman.com/wordpress/?p=246

As for why not use mmap in the first place, this is a long running
debate.  See
http://wiki.postgresql.org/wiki/Todo#Miscellaneous_Performance for a
quick intro to the issues involved.  There are portability, database
consistency, and code complexity issues around such a change, and the
practical benefit of the change is not so obvious as to make hurdling
those seem a priority.  Plenty of easier changes around with completely
unambiguous benefits to work on instead.

--
Greg Smith    2ndQuadrant   Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com  www.2ndQuadrant.com


pgsql-general by date:

Previous
From: Greg Smith
Date:
Subject: Re: Multiple buffer cache?
Next
From: Gaëtan Allart
Date:
Subject: SELECT DISTINCT triggers sorting operation