Re: BUG #4313: Strange optimizer behaviour - Mailing list pgsql-bugs

From Gregory Stark
Subject Re: BUG #4313: Strange optimizer behaviour
Date
Msg-id 87fxq834u1.fsf@oxford.xeocode.com
Whole thread Raw
In response to BUG #4313: Strange optimizer behaviour  ("Daniel Podlejski" <daniel.podlejski@gmail.com>)
List pgsql-bugs
"Daniel Podlejski" <daniel.podlejski@gmail.com> writes:

> I think there is no sense to cast too big value to numeric when field type
> is integer.
> On really big table this "bug" cause unnecessary io load.

Well, for example, the same logic doesn't hold for < where all the records
would satisfy the inequality but only numeric.< will be able to handle the
argument.

I think you could get the behaviour you're looking for by using an untyped
quoted constant like '11111111111111111111111111111111111111111111111111'
instead of using an integer constant. The fact that these two cases behave
differently is a bit confusing too.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's On-Demand Production Tuning

pgsql-bugs by date:

Previous
From: "Daniel Podlejski"
Date:
Subject: BUG #4313: Strange optimizer behaviour
Next
From: "jspxnet"
Date:
Subject: BUG #4315: message encoding is error,not show chinese