Re: BUG #4313: Strange optimizer behaviour

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Daniel Podlejski" <daniel(dot)podlejski(at)gmail(dot)com>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #4313: Strange optimizer behaviour
Date: 2008-07-17 15:31:18
Message-ID: 87fxq834u1.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Daniel Podlejski" <daniel(dot)podlejski(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message jspxnet 2008-07-18 08:20:37 BUG #4315: message encoding is error,not show chinese
Previous Message Daniel Podlejski 2008-07-17 14:37:53 BUG #4313: Strange optimizer behaviour