Re: how to evaluate a function only once for a query?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nicolae Mihalache <mache(at)abcpages(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to evaluate a function only once for a query?
Date: 2002-06-20 13:12:48
Message-ID: 11294.1024578768@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Nicolae Mihalache <mache(at)abcpages(dot)com> writes:
> I've created a function timevalue(text) that returns a timestamp as
> result. The function works just fine.
> However, when I do a query like:
> "select * from mytable where time<timevalue('something')" I see that my
> function is evaluated once for each row in mytable.

See the "isCachable" attribute in CREATE FUNCTION.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fran Fabrizio 2002-06-20 13:16:13 Re: db grows and grows
Previous Message Fran Fabrizio 2002-06-20 13:12:44 Re: db grows and grows