Re: Calling the same function more than once with the same

From: Ben <bench(at)silentmedia(dot)com>
To: Clodoaldo Pinto <clodoaldo(dot)pinto(at)gmail(dot)com>
Cc: "pgsql-general postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Calling the same function more than once with the same
Date: 2006-04-19 21:38:33
Message-ID: Pine.LNX.4.64.0604191438150.15001@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Look into the immutable flag on function creation:

http://www.postgresql.org/docs/8.1/interactive/xfunc-volatility.html

On Wed, 19 Apr 2006, Clodoaldo Pinto wrote:

> I'm building a function caller() in which a certain function called()
will be called many times in from clauses with the same arguments and
I'm wondering if is there a performance penalty for that or if the sql
engine is smart enough to call called() only once.

I tried to substitute called() in the from clauses for a temporary
table created first in caller() but it refuses to build caller() with
the message "ERROR: relation "temp_table_name" does not exist". It
does not exist in build time but it will exist in run time.

Regards, Clodoaldo Pinto

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message sconeek 2006-04-19 23:04:04 deleting table content through command prompt
Previous Message Clodoaldo Pinto 2006-04-19 21:29:32 Calling the same function more than once with the same arguments