Does CREATE FUNCTION... WITH (ISCACHABLE) work?

Поиск
Список
Период
Сортировка
От Joel Burton
Тема Does CREATE FUNCTION... WITH (ISCACHABLE) work?
Дата
Msg-id 3975A1BD.30413.965FF81@localhost
обсуждение исходный текст
Ответы Re: Does CREATE FUNCTION... WITH (ISCACHABLE) work?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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.

Does this actually work yet? A simple test case:

CREATE FUNCTION f() RETURNS INT AS '
BEGIN
  raise notice ''foo'';
  return 1;
end;
' LANGUAGE 'plpgsql' WITH (ISCACHABLE);

SELECT o();
NOTICE: foo
o
___
1
(1 row)

SELECT o();
NOTICE: foo
o
____
(1 row)

It might be that the parser is smart enough to copy any output
(such as the RAISE NOTICE), my fear is that it is actually running
the function a second time.

Does anyone know if this caching actually happens yet, or is this a
future feature?

Thanks.
--
Joel Burton, Director of Information Systems -*- jburton@scw.org
Support Center of Washington (www.scw.org)

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: tcl/tk interface on Digital Unix
Следующее
От: "kurt miller"
Дата:
Сообщение: Query problem - explicit casts