pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Conway <neilc@samurai.com>
To: Rosser Schwarz <rschwarz@totalcardinc.com>
Cc: Vitaly Belman <vitalib@012.net.il>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: PostgreSQL caching
Date: Fri, 21 May 2004 15:02:32 -0400
Message-ID: <40AE5248.8090807@samurai.com> (raw)
In-Reply-To: <002801c43f48$6d629930$2500fa0a@CardServices.TCI.com>
References: <002801c43f48$6d629930$2500fa0a@CardServices.TCI.com>

Rosser Schwarz wrote:
> PostgreSQL uses the operating system's disk cache.

... in addition to its own buffer cache, which is stored in shared 
memory. You're correct though, in that the best practice is to keep the 
PostgreSQL cache small and give more memory to the operating system's 
disk cache.

> Pgsql uses the OS's disk cache instead of its own cache management
> because the former is more likely to persist.  If the postmaster
> managed the cache, as soon as the last connection died, the memory
> allocated for caching would be released, and all the cached data
> would be lost.

No; the cache is stored in shared memory. It wouldn't persist over 
postmaster restarts (without some scheme of saving and restoring it), 
but that has nothing to do with why the OS disk cache is usually kept 
larger than the PG shared buffer cache.

-Neil




view thread (26+ messages)  latest in thread

Message-ID: <40AE5248.8090807@samurai.com>
Permalink:  ../40AE5248.8090807@samurai.com/
Also on:    postgresql.org/message-id/40AE5248.8090807@samurai.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: neilc@samurai.com, rschwarz@totalcardinc.com, vitalib@012.net.il
  Subject: Re: PostgreSQL caching
  In-Reply-To: <40AE5248.8090807@samurai.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox