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-05 00:30:32
Message-ID: gc91qp$2d24$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com> writes:
>> Shouldn't PG make all efforts to not execute something when the result is
>> already known?
>
> Not if said effort would cost more than is saved, which would be by far
> the most likely result if we tried to cache all function results.
>
> regards, tom lane
>
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.

Perhaps I can get around this problem by creating a temp table inside
the function that is dropped on transaction commit.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2008-10-05 04:30:57 Re: db_user_namespace, md5 and changing passwords
Previous Message Richard Broersma 2008-10-04 19:42:37 PG Windows Installer Feature Request