Re: performance issue: logical operators are slow inside SQL function: missing optimalization?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: performance issue: logical operators are slow inside SQL function: missing optimalization?
Date: 2010-08-29 18:08:54
Message-ID: 20512.1283105334@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> On Sun, Aug 29, 2010 at 11:23:29AM -0400, Tom Lane wrote:
>> It has nothing to do with boolean operators, just double evaluation.

> I was wondering, wouldn't it be possible to avoid the double evaluation
> by simply creating an extra slot for the intermediate value.

Possibly, but the trick would be to figure out when to evaluate the
values so that it would still behave the same as without inlining.
I don't think the existing Param mechanism could do this without
some additional help.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2010-08-29 18:15:47 Re: performance issue: logical operators are slow inside SQL function: missing optimalization?
Previous Message Martijn van Oosterhout 2010-08-29 15:46:27 Re: performance issue: logical operators are slow inside SQL function: missing optimalization?