Re: Static functions

From: Joseph S <jks(at)selectacast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Static functions
Date: 2008-10-06 22:13:56
Message-ID: gce2j0$1d77$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout wrote:
> On Sat, Oct 04, 2008 at 08:30:32PM -0400, Joseph S wrote:
>> In this case, with the function being called over and over again inside
>> a nested loop, it would be worth the effort. I'm not even talking about
>> caching the result for the whole transaction block, just replacing the
>> function call before continuing the query.
>
> I think you're going to have to be more specific, because if the
> function is stable or immutable, pg will do exactly as you say. Post
> the actual query involved.
>
SELECT distinct(uid) FROM elog,j WHERE elog.type IN(1,4) AND j.id =
elog.jid AND j.pod = 3 AND j.mtotal > 0 AND j.stdate > '2008-01-01
00:00:00.0' AND elog.id >= elog_date_search('2008-01-01 00:00:00') AND
j.stdate < '2008-10-06 23:59:59.0';

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-10-06 23:06:58 Re: feature idea
Previous Message Brent Wood 2008-10-06 21:51:38 Re: postgres/postgis