Re: Postgres Optimizer is not smart enough? - Mailing list pgsql-performance

From Tom Lane
Subject Re: Postgres Optimizer is not smart enough?
Date
Msg-id 4337.1105583973@sss.pgh.pa.us
Whole thread Raw
In response to Re: Postgres Optimizer is not smart enough?  (Mark Kirkwood <markir@coretech.co.nz>)
Responses Re: Postgres Optimizer is not smart enough?
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Postgres Optimizer is not smart enough?
Next
From: Joe Conway
Date:
Subject: Re: PostgreSQL vs. Oracle vs. Microsoft