Re: Configuring for maximum memory usage

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Scott Carey <scott(at)richrelevance(dot)com>
Cc: Christiaan Willemsen <cwillemsen(at)technocon(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Configuring for maximum memory usage
Date: 2008-10-30 16:55:30
Message-ID: 1225385730.32621.21.camel@jd-laptop.pragmaticzealot.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, 2008-10-30 at 09:46 -0700, Scott Carey wrote:

>
> Remember that PostgreSQL doesn't cache anything on its own so
> if you do
> want to hit disk it has to be in file cache.
>
> By my understanding, this is absolutely false. Postgres caches pages
> from tables/indexes in shared_buffers. You can make this very large if
> you wish.

You can make it very large with a potentially serious performance hit.
It is very expensive to manage large amounts of shared buffers. It can
also nail your IO on checkpoint if you are not careful (even with
checkpoint smoothing). You are correct that I did not explain what I
meant very well because shared buffers are exactly that, shared
buffers.

However that isn't the exact same thing as a "cache" at least as I was
trying to describe it. shared buffers are used to keep track of pages
(as well as some other stuff) and their current status. That is not the
same as caching a relation.

It is not possible to pin a relation to memory using PostgreSQL.
PostgreSQL relies on the operating system for that type of caching.

Joshua D. Drake

--

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Christiaan Willemsen 2008-10-30 16:56:16 Re: Configuring for maximum memory usage
Previous Message Scott Carey 2008-10-30 16:46:22 Re: Configuring for maximum memory usage