Re: Questions on query planner, join types, and work_mem

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hannu Krosing <hannu(at)2ndquadrant(dot)com>, Peter Hussey <peter(at)labkey(dot)com>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Questions on query planner, join types, and work_mem
Date: 2010-08-12 02:39:40
Message-ID: AANLkTi=5KxVN1tA2jsAV7mzu7H0Lg8S+Gm=O9JAvcrzE@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Aug 11, 2010 at 9:42 PM, Bruce Momjian <bruce(at)momjian(dot)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.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2010-08-12 03:16:54 Re: performance sol10 zone (fup)
Previous Message Bruce Momjian 2010-08-12 01:42:32 Re: Questions on query planner, join types, and work_mem