Re: Calling the same function more than once with the

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Clodoaldo Pinto <clodoaldo(dot)pinto(at)gmail(dot)com>, "pgsql-general postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Calling the same function more than once with the
Date: 2006-04-20 14:11:59
Message-ID: 1145542319.23538.127.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2006-04-19 at 18:23, Tom Lane wrote:
> "Clodoaldo Pinto" <clodoaldo(dot)pinto(at)gmail(dot)com> writes:
> > 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.
>
> No, it isn't.

HOWEVER, depending on how you declare the function, you should be able
to index it.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-04-20 14:28:41 Re: FW: code to cancel a running query, worker thread
Previous Message Jim Buttafuoco 2006-04-20 11:55:50 Re: Query to check existence of stored procedure?