Re: How to use index in WHERE int = float - Mailing list pgsql-general

From Tom Lane
Subject Re: How to use index in WHERE int = float
Date
Msg-id 7423.1226269359@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to use index in WHERE int = float  ("Andrus" <kobruleht2@hot.ee>)
Responses Re: How to use index in WHERE int = float  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
"Andrus" <kobruleht2@hot.ee> writes:
>> The IN-pullup code runs before constant-simplification does, so it
>> doesn't see that as a simple join condition.

> Seems serious design flaw.
> How to change expression parser so that contant parts of expressions are
> removed before IN-pullup?

It would be far simpler to fix your query generator to not emit the
useless "0 or".

Even if we made the planner deal with that, the number of cycles it
would expend to recover from the generator's stupidity would be several
orders of magnitude higher than the number of cycles needed to not be so
stupid.

            regards, tom lane

pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: Re: How to use index in WHERE int = float
Next
From: Blazej
Date:
Subject: Re: Chart of Accounts