pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@ymail.com>
To: Torsten Förtsch <torsten.foertsch@gmx.net>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: planner parameters
Date: Tue, 3 Sep 2013 12:02:00 -0700 (PDT)
Message-ID: <1378234920.66126.YahooMailNeo@web162906.mail.bf1.yahoo.com> (raw)
In-Reply-To: <5224ED90.7030808@gmx.net>
References: <5224ED90.7030808@gmx.net>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Torsten Förtsch <torsten.foertsch@gmx.net> wrote:

> Is there an other way to make the planner use generate the 1st
> plan?

The planner cost factors are based on the assumption that a
moderate percentage of random page reads will need to actually go
out to disk.  If a high percentage of pages are in cache, you may
want to reduce random_page_cost to something closer to (or even
equal to) seq_page_cost.  I generally find I get better plans if I
raise cpu_tuple_cost to 0.03.  effective_cache_size should
generally be between 50% and 75% of machine RAM.  If these changes
(or others of their ilk) cause costs to be estimated in a way which
more nearly matches reality, better plans will be chosen.

> Why does it generate the 2nd plan at all?

It has the lowest estimated cost, based on your memory
configuration and cost factors.

> Does the planner take into account what is currently present in
> shared memory?

No.  If you search the archives you can probably find previous
discussions of whether it would be a good idea to do so; the
consensus has been that it would not be.

If you have further performance-related questions, please review
this page so that you can provide enough information to allow
people to give the most helpful advice:

http://wiki.postgresql.org/wiki/SlowQueryQuestions

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (2+ messages)

Message-ID: <1378234920.66126.YahooMailNeo@web162906.mail.bf1.yahoo.com>
Permalink:  ../1378234920.66126.YahooMailNeo@web162906.mail.bf1.yahoo.com/
Also on:    postgresql.org/message-id/1378234920.66126.YahooMailNeo@web162906.mail.bf1.yahoo.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: kgrittn@ymail.com, torsten.foertsch@gmx.net
  Subject: Re: planner parameters
  In-Reply-To: <1378234920.66126.YahooMailNeo@web162906.mail.bf1.yahoo.com>

* 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