pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: gsaviane@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6787: Query planner estimates worng costs on nodes
Date: Tue, 31 Jul 2012 18:13:07 -0400
Message-ID: <16671.1343772787@sss.pgh.pa.us> (raw)
In-Reply-To: <E1SwE1s-0002Ek-PV@wrigleys.postgresql.org>
References: <E1SwE1s-0002Ek-PV@wrigleys.postgresql.org>

gsaviane@gmail.com writes:
> It seems the cost assigned to a sequential scan over 120 million records is
> too low or, on the other side, the cost assigned to two nested loop over
> three indexes is too high.

It looks from here like you are measuring a situation where
vb_product_readings is fully cached in RAM.  If that's the normal
situation in your database, then you ought to decrease the
random_page_cost setting to make the planner's cost estimates reflect
your reality.  The default setting is intended to model situations
where a fair amount of disk access is going to happen.

			regards, tom lane



view thread (2+ messages)

Message-ID: <16671.1343772787@sss.pgh.pa.us>
Permalink:  ../16671.1343772787@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16671.1343772787@sss.pgh.pa.us

 · 

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 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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gsaviane@gmail.com
  Subject: Re: BUG #6787: Query planner estimates worng costs on nodes
  In-Reply-To: <16671.1343772787@sss.pgh.pa.us>
  References: <E1SwE1s-0002Ek-PV@wrigleys.postgresql.org> <16671.1343772787@sss.pgh.pa.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