Re: Sequential Scan Index Bug - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Sequential Scan Index Bug
Date
Msg-id 26750.1081366118@sss.pgh.pa.us
Whole thread Raw
In response to Re: Sequential Scan Index Bug  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-bugs
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> It's possible that we could do something more intelligent than the current
> behavior for that case but I can't come up with a particularly good
> choice that wouldn't have bad effects elsewhere.

In theory we could recognize that "integer_column = 4.35" will yield a
constant false.  If the expression were replaced by "false" during
constant folding then the planner would produce a short-circuited plan
that won't actually examine the table.

In practice, though, I don't see any way to do that that wouldn't be a
horrendous kluge.  I don't like putting special-case type-specific
knowledge into the planner; yet here we have knowledge that's not only
type-specific but specific to the combination of two different types.
Yech.  I don't see any hope for a catalog-driven, extensible approach
for such things.

You'd also have to ask questions about whether the planner time spent
testing for such cases would really be a good investment...

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: INSERT INTO ... SELECT
Next
From: Tom Lane
Date:
Subject: Re: BUG #1129: select query returns multiple results for a japanese characters