Re: short-cutting if sum()>constant

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>, pgsql-sql(at)postgresql(dot)org
Subject: Re: short-cutting if sum()>constant
Date: 2009-12-23 16:36:31
Message-ID: 28619.1261586191@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Craig Ringer <craig(at)postnewspapers(dot)com(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ivan Sergio Borgonovo 2009-12-23 17:43:18 Re: short-cutting if sum()>constant
Previous Message Pavel Stehule 2009-12-23 16:04:37 Re: short-cutting if sum()>constant