Re: short-cutting if sum()>constant - Mailing list pgsql-sql

From Tom Lane
Subject Re: short-cutting if sum()>constant
Date
Msg-id 28619.1261586191@sss.pgh.pa.us
Whole thread Raw
In response to Re: short-cutting if sum()>constant  (Craig Ringer <craig@postnewspapers.com.au>)
Responses Re: short-cutting if sum()>constant  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List pgsql-sql
Craig Ringer <craig@postnewspapers.com.au> writes:
> Pavel Stehule wrote:
>> these queries are executed in some special mode, but still it is more
>> expensive than C a = a + 1

> ... and may have different rules, so you can't just write a simple "map
> expressions to C equivalents" arithmetic evaluator.

Yeah.  As an example, overflow is supposed to be caught in "a + 1",
unlike what would happen in C.

In principle you could map some of the builtin operators into inline
code, but it would be a great deal of work and the results would be
un-portable.
        regards, tom lane


pgsql-sql by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: short-cutting if sum()>constant
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: short-cutting if sum()>constant