Skip site navigation (1) Skip section navigation (2)

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: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: 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 15:23:29
Message-ID: 17549.1283095409@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> 2010/8/29 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> The one case is inline-able and the other not (because it would result
>> in double evaluation of the volatile function random()).
>> See EXPLAIN VERBOSE.

> I understand now. So it means general advice - don't use a boolean
> operators in SQL function? This issue should be documented somewhere?

It has nothing to do with boolean operators, just double evaluation.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Pavel StehuleDate: 2010-08-29 15:42:44
Subject: Re: performance issue: logical operators are slow inside SQL function: missing optimalization?
Previous:From: Pavel StehuleDate: 2010-08-29 15:21:25
Subject: Re: performance issue: logical operators are slow inside SQL function: missing optimalization?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group