Re: Multiple buffer cache?

From: Alexei Vladishev <alexei(dot)vladishev(at)zabbix(dot)com>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Multiple buffer cache?
Date: 2010-02-09 19:26:22
Message-ID: 4B71B6DE.3000204@zabbix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greg,

> Alexei Vladishev wrote:
>> Is there a way of configuring PostgreSQL so that one specific table
>> would
>> use, say, 4GB of buffer cache while other tables would use the rest?
>
> It sounds like you're looking for what other databases call
> "pinning". It's not supported in PostgreSQL right now, and as far as
> I know it's not on anybody's hotlist of features they're working on.
> It would be straightforward to add actually; I know exactly where the
> code that evicts pages from the buffer cache would need to be tweaked
> to support this. See the "Inside the PostgreSQL Buffer Cache"
> presentation at http://www.westnet.com/~gsmith/content/postgresql/ for
> more details about how the current implementation works. Be happy to
> talk about what what it would take to sponsor the bit of development
> required if this is something you really need for your app--it's not a
> giant feature to build, just not one that anyone has needed badly
> enough so far to bother writing.
Thank you for the link. Lots of useful information there.

>> I would like to keep the table and its indexes always in "hot" state,
>> so that
>> other queries won't pollute this part of the buffer cache. It would
>> ensure
>> reliable performance and much less disk IOPS working with the table.
>
> The PostgreSQL design presumes that the OS cache is significantly
> larger than the RAM dedicated to the database, so a database cache
> miss doesn't necessarily turn into physical I/O. Part of the reason
> this feature hasn't been been perceived as more valuable is because
> just letting the two cache levels involved here sort out what's really
> valuable or not can often outperform what an application developer
> thinks the optimal configuration will be.
Interesting! I assumed that it is a common practice to dedicate most of
the RAM to a database engine leaving only small percentage to OS.

Kind regards,
Alexei

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Justin Graf 2010-02-09 19:40:14 Re: Best way to handle multi-billion row read-only table?
Previous Message Alvaro Herrera 2010-02-09 19:18:16 Re: SSL connection lost after long-lasting copy command