From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Joel Burton" <jburton(at)scw(dot)org> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Does CREATE FUNCTION... WITH (ISCACHABLE) work? |
Date: | 2000-07-19 18:30:08 |
Message-ID: | 22079.964031408@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
"Joel Burton" <jburton(at)scw(dot)org> writes:
> I have a function that always returns the same answer given the
> same input (no database lookups, etc.). The pg Users' Manual
> documents the attribute 'iscachable' as allowing the database to
> parse the results of the function and not keep looking it up.
iscachable does not mean that the system will cache the results of the
function across queries, it just means that the function needn't be
re-evaluated multiple times for the same arguments within a single query.
For example, given
SELECT * from table1 where col = foo(42);
If foo() is marked cachable then it's evaluated once during query
planning; if not it's evaluated again for each row scanned in table1.
I don't think anyone has plans to implement a function result cache
across queries. Most of the time it'd be a waste of space and cycles...
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Swaminathan R. Iyer | 2000-07-19 21:16:09 | Retrieving images from PG using Java |
Previous Message | Joel Burton | 2000-07-19 16:40:29 | Does CREATE FUNCTION... WITH (ISCACHABLE) work? |