Re: PostgreSQL caching

From: Neil Conway <neilc(at)samurai(dot)com>
To: Rosser Schwarz <rschwarz(at)totalcardinc(dot)com>
Cc: 'Vitaly Belman' <vitalib(at)012(dot)net(dot)il>, 'Postgresql Performance' <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL caching
Date: 2004-05-21 19:02:32
Message-ID: 40AE5248.8090807@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Matthew T. O'Connor 2004-05-21 19:22:40 Re: Avoiding vacuum full on an UPDATE-heavy table
Previous Message Rod Taylor 2004-05-21 18:33:54 Re: PostgreSQL caching