From: Jim C. Nasby <jim@nasby.net>
To: Manfred Koizar <mkoi-pg@aon.at>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: More tablescanning fun
Date: Sun, 4 May 2003 11:22:14 -0500
Message-ID: <20030504112214.V66185@flake.decibel.org> (raw)
In-Reply-To: <iilvavo0jj8frdj6e9a9p6ise3gci5icj7@4ax.com>
References: <20030424183817.A66185@flake.decibel.org>
<3660.1051228710@sss.pgh.pa.us>
<20030424235924.B66185@flake.decibel.org>
<13549.1051248190@sss.pgh.pa.us>
<20030425093800.C66185@flake.decibel.org>
<iilvavo0jj8frdj6e9a9p6ise3gci5icj7@4ax.com>
On Wed, Apr 30, 2003 at 04:14:46PM +0200, Manfred Koizar wrote:
> On Fri, 25 Apr 2003 09:38:01 -0500, "Jim C. Nasby" <jim@nasby.net>
> wrote:
> >In this case, the interpolation can't be at fault, because correlation
> >is 1 (unless the interpolation is backwards, but that doesn't appear to
> >be the case).
>
> But your index has 3 columns which causes the index correlation to be
> assumed as 1/3. So the interpolation uses 1/9 (correlation squared)
> and you get a cost estimation that almost equals the upper bound.
Hmm... interesting... maybe it would also be a good idea to expand
ANALYZE so that it will analyze actual index correlation? ie: in this
case, it would notice that the index on project_id, id, date is highly
correlated, across all 3 columns.
Supporting something close to a real clustered index would also work as
well, since the optimizer would treat that case differently (essentially
as a combination between an index scan but doing a seq. scan within each
page).
--
Jim C. Nasby (aka Decibel!) jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828
Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"
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: jim@nasby.net, mkoi-pg@aon.at, tgl@sss.pgh.pa.us
Subject: Re: More tablescanning fun
In-Reply-To: <20030504112214.V66185@flake.decibel.org>
References: <20030424183817.A66185@flake.decibel.org> <3660.1051228710@sss.pgh.pa.us> <20030424235924.B66185@flake.decibel.org> <13549.1051248190@sss.pgh.pa.us> <20030425093800.C66185@flake.decibel.org> <iilvavo0jj8frdj6e9a9p6ise3gci5icj7@4ax.com> <20030504112214.V66185@flake.decibel.org>
* 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