Re: Function is called multiple times in subselect - Mailing list pgsql-bugs

From Alex J. Avriette
Subject Re: Function is called multiple times in subselect
Date
Msg-id 20040312201319.GY6396@posixnap.net
Whole thread Raw
In response to Re: Function is called multiple times in subselect  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Fri, Mar 12, 2004 at 09:41:39AM -0500, Tom Lane wrote:

> > And if you are concerned about the query's cost vs its actual output
> > (you weren't clear in your original message), there is the 'iscachable'
> > pragma for functions.

> One of the reasons we renamed that pragma to "immutable" is that too
> many people were interpreting it as suggesting that Postgres would do
> some kind of caching of the function's results.  There is no such cache.

Well, I'm glad you told me that. However, I think that it could still be
useful. This allows indices to be built upon the results of functions. In
one case this proved to be tremendously fast compared to using lower(foo)
dynamically. lower(foo) will always return the same value, as would the
original poster's.

But I digress.

Alex

--
alex@posixnap.net
Alex J. Avriette, Unix Systems Gladiator
"Shut down some of the bullshit the government is spending money on and use it
to buy all the Microsoft stock. If we did that, we could ... just bronze Gates,
turn him into a statue, and stick him in front of the Commerce Department." - Scott McNealy

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Function is called multiple times in subselect
Next
From: Christopher Browne
Date:
Subject: Re: buglet in 7.1.4