pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig Ringer <craig@postnewspapers.com.au>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Ivan Sergio Borgonovo <mail@webthatworks.it>
Cc: pgsql-sql@postgresql.org
Subject: Re: short-cutting if sum()>constant
Date: Wed, 23 Dec 2009 11:36:31 -0500
Message-ID: <28619.1261586191@sss.pgh.pa.us> (raw)
In-Reply-To: <4B323F21.3020007@postnewspapers.com.au>
References: <20091222133527.3007bd96@dawn.webthatworks.it>
	<162867790912221147r7e3041fej44332a05faf915d6@mail.gmail.com>
	<20091223000031.54ad09b5@dawn.webthatworks.it>
	<20091223010940.51c5c069@dawn.webthatworks.it>
	<20091223024635.48d66554@dawn.webthatworks.it>
	<162867790912222338v73261b73u5c4e88a5ce85918f@mail.gmail.com>
	<20091223115628.1709caf5@dawn.webthatworks.it>
	<162867790912230352v5b6e395fm1880111c04eaa626@mail.gmail.com>
	<4B323F21.3020007@postnewspapers.com.au>

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



view thread (23+ messages)  latest in thread

Message-ID: <28619.1261586191@sss.pgh.pa.us>
Permalink:  ../28619.1261586191@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28619.1261586191@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, craig@postnewspapers.com.au, pavel.stehule@gmail.com, mail@webthatworks.it
  Subject: Re: short-cutting if sum()>constant
  In-Reply-To: <28619.1261586191@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox