From: Jim C. Nasby <jnasby@pervasive.com>
To: Guillaume Cottenceau <gc@mnc.ch>
Cc: pgsql-performance@postgresql.org
Subject: Re: planner with index scan cost way off actual cost, advices to tweak cost constants?
Date: Tue, 21 Mar 2006 11:45:57 -0600
Message-ID: <20060321174556.GF15742@pervasive.com> (raw)
In-Reply-To: <8764m8kjrl.fsf@meuh.mnc.lan>
References: <87ek11gz69.fsf@meuh.mnc.lan>
<1d4e0c10603180220se128a79r71534db9349bd746@mail.gmail.com>
<87hd5tmt1z.fsf@meuh.mnc.lan>
<20060321095700.GX15742@pervasive.com>
<87irq8kswd.fsf@meuh.mnc.lan>
<20060321115835.GN15742@pervasive.com>
<8764m8kjrl.fsf@meuh.mnc.lan>
On Tue, Mar 21, 2006 at 02:30:22PM +0100, Guillaume Cottenceau wrote:
> "Jim C. Nasby" <jnasby 'at' pervasive.com> writes:
>
> > If you feel like running some tests, you need to change
> >
> > run_cost += max_IO_cost + csquared * (min_IO_cost - max_IO_cost);
> >
> > in src/backend/optimizer/path/costsize.c to something like
> >
> > run_cost += max_IO_cost + abs(indexCorrelation) * (min_IO_cost - max_IO_cost);
>
> Short after the beginning of a discussion about planner
> associating too high cost for index scan, I'm suggested to change
> source-code.. I'm already frightened about the near future :)
Well, this is mostly because I've just never gotten around to following
up on this.
> > That might not produce a perfect cost estimate, but I'll wager that it
> > will be substantially better than what's in there now. FYI, see also
> > http://archives.postgresql.org/pgsql-performance/2005-04/msg00669.php
>
> Sad that Tom didn't share his thoughts about your cost algorithm
> question in this message.
See above. :)
If someone comes up with a before and after comparison showing that the
change makes the estimator more accurate I'm sure the code will be
changed in short order. The nice thing about this case is that basically
any PostgreSQL user can do the heavy lifting, instead of relying on the
primary contributors for a change.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461
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: jnasby@pervasive.com, gc@mnc.ch
Subject: Re: planner with index scan cost way off actual cost, advices to tweak cost constants?
In-Reply-To: <20060321174556.GF15742@pervasive.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