From: Bruce Momjian <bruce@momjian.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Hannu Krosing <hannu@2ndquadrant.com>
Cc: Peter Hussey <peter@labkey.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Questions on query planner, join types, and work_mem
Date: Mon, 31 Jan 2011 22:17:57 -0500 (EST)
Message-ID: <201102010317.p113Hvc07473@momjian.us> (raw)
In-Reply-To: <AANLkTi=5KxVN1tA2jsAV7mzu7H0Lg8S+Gm=O9JAvcrzE@mail.gmail.com>
Robert Haas wrote:
> On Wed, Aug 11, 2010 at 9:42 PM, Bruce Momjian <bruce@momjian.us> wrote:
> > This confused me. ?If we are assuing the data is in
> > effective_cache_size, why are we adding sequential/random page cost to
> > the query cost routines?
>
> See the comments for index_pages_fetched(). We basically assume that
> all data starts uncached at the beginning of each query - in fact,
> each plan node. effective_cache_size only measures the chances that
> if we hit the same block again later in the execution of something
> like a nested-loop-with-inner-indexscan, it'll still be in cache.
>
> It's an extremely weak knob, and unless you have tables or indices
> that are larger than RAM, the only mistake you can make is setting it
> too low.
The attached patch documents that there is no assumption that data
remains in the disk cache between queries. I thought this information
might be helpful.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
Attachments:/rtmp/effective.diff (text/x-diff, 1.0K) downloaddiff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgmlindex 77cacdd..520170b 100644
*** a/doc/src/sgml/config.sgml
--- b/doc/src/sgml/config.sgml
*************** SET ENABLE_SEQSCAN TO OFF;
*** 2424,2430 ****
space. This parameter has no effect on the size of shared
memory allocated by <productname>PostgreSQL</productname>, nor
does it reserve kernel disk cache; it is used only for estimation
! purposes. The default is 128 megabytes (<literal>128MB</>).
</para>
</listitem>
</varlistentry>
--- 2424,2432 ----
space. This parameter has no effect on the size of shared
memory allocated by <productname>PostgreSQL</productname>, nor
does it reserve kernel disk cache; it is used only for estimation
! purposes. The system also does not assume data remains in
! the disk cache between queries. The default is 128 megabytes
! (<literal>128MB</>).
</para>
</listitem>
</varlistentry>
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: bruce@momjian.us, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, hannu@2ndquadrant.com, peter@labkey.com
Subject: Re: Questions on query planner, join types, and work_mem
In-Reply-To: <201102010317.p113Hvc07473@momjian.us>
References: <AANLkTi=5KxVN1tA2jsAV7mzu7H0Lg8S+Gm=O9JAvcrzE@mail.gmail.com> <201102010317.p113Hvc07473@momjian.us>
* 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