effective_cache_size

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Subject: effective_cache_size
Date: 2002-07-11 12:25:30
Message-ID: fhqqiukgmorla7tdcdbt690d1ms310hddj@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The estimator only uses effective_cache_size, it never looks at
NBuffers. So shouldn't we add
if (effective_cache_size < NBuffers)
{
elog(NOTICE, "adjusting effective_cache_size to %d",
NBuffers);
effective_cache_size = NBuffers;
}

somewhere near
* Check for invalid combinations of switches

in postmaster.c? I can see only one reason not to it: If
effective_cache_size were meant as a hint to the backend that it
cannot count on the whole buffer cache, because it has to share the
cache with other backends; though I didn't find any indication of
such an intention. Am I missing something else?

In costsize.c there is this comment:

* We also use a rough estimate "effective_cache_size" of the number
of
* disk pages in Postgres + OS-level disk cache. (We can't simply use
* NBuffers for this purpose because that would ignore the effects of
* the kernel's disk cache.)

In the docs we have:

EFFECTIVE_CACHE_SIZE (floating point): Sets the optimizer's
assumption about the effective size of the disk cache (that is, the
portion of the kernel's disk cache that will be used for PostgreSQL
data files). This is measured in disk pages, which are normally 8 kB
each.

What about adding something like "including the effects of the
backend's own shared buffers" here?

Servus
Manfred

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vince Vielhaber 2002-07-11 12:27:19 Re: I am being interviewed by OReilly
Previous Message Vince Vielhaber 2002-07-11 09:31:10 Re: I am being interviewed by OReilly