pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dennis Björklund <db@zigo.dhs.org>
Cc: Fabian Kreitner <fabian.kreitner@ainea-ag.de>
Cc: pgsql-performance@postgresql.org
Subject: Re: index / sequential scan problem
Date: Fri, 18 Jul 2003 09:24:58 -0400
Message-ID: <23376.1058534698@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.44.0307180723040.4146-100000@zigo.dhs.org>
References: <Pine.LNX.4.44.0307180723040.4146-100000@zigo.dhs.org>

=?ISO-8859-1?Q?Dennis_Bj=F6rklund?= <db@zigo.dhs.org> writes:
> On Fri, 18 Jul 2003, Fabian Kreitner wrote:
>> Adjusting the cpu_tuple_cost to 0.042 got the planner to choose the index.

> Doesn't sound very good and it will most likely make other queries slower.

Seems like a reasonable approach to me --- certainly better than setting
random_page_cost to physically nonsensical values.

In a fully-cached situation it's entirely reasonable to inflate the
various cpu_xxx costs, since by assumption you are not paying the normal
price of physical disk I/O.  Fetching a page from kernel buffer cache
is certainly cheaper than getting it off the disk.  But the CPU costs
involved in processing the page contents don't change.  Since our cost
unit is defined as 1.0 = one sequential page fetch, you have to increase
the cpu_xxx numbers instead of reducing the I/O cost estimate.

I would recommend inflating all the cpu_xxx costs by the same factor,
unless you have evidence that they are wrong in relation to each other.

			regards, tom lane



view thread (19+ messages)  latest in thread

Message-ID: <23376.1058534698@sss.pgh.pa.us>
Permalink:  ../23376.1058534698@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23376.1058534698@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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, db@zigo.dhs.org, fabian.kreitner@ainea-ag.de
  Subject: Re: index / sequential scan problem
  In-Reply-To: <23376.1058534698@sss.pgh.pa.us>
  References: <Pine.LNX.4.44.0307180723040.4146-100000@zigo.dhs.org> <23376.1058534698@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