From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mark Kirkwood <markir@coretech.co.nz>
Cc: Litao Wu <litaowu@yahoo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Postgres Optimizer is not smart enough?
Date: Wed, 12 Jan 2005 21:39:33 -0500
Message-ID: <4337.1105583973@sss.pgh.pa.us> (raw)
In-Reply-To: <41E5AF3F.2080100@coretech.co.nz>
References: <20050112222506.32084.qmail@web13124.mail.yahoo.com>
<41E5AF3F.2080100@coretech.co.nz>
Mark Kirkwood <markir@coretech.co.nz> writes:
> I happen to have some debugging code enabled for the optimizer, and the
> issue appears to be that the costs of paths using these indexes are
> quite similar, so are quite sensitive to (some) parameter values.
They'll be exactly the same, actually, as long as the thing predicts
exactly one row retrieved. So it's quasi-random which plan you get.
btcostestimate needs to be improved to understand that in multicolumn
index searches with inequality conditions, we may have to scan through
tuples that don't meet all the qualifications. It's not accounting for
that cost at the moment, which is why the estimates are the same.
regards, tom lane
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: tgl@sss.pgh.pa.us, markir@coretech.co.nz, litaowu@yahoo.com
Subject: Re: Postgres Optimizer is not smart enough?
In-Reply-To: <4337.1105583973@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