cacheable stored functions?

Поиск
Список
Период
Сортировка
От Bill Moran
Тема cacheable stored functions?
Дата
Msg-id 40362944.2060809@potentialtech.com
обсуждение исходный текст
Ответы Re: cacheable stored functions?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: cacheable stored functions?  (Tomasz Myrta <jasiek@klaster.net>)
Re: cacheable stored functions?  (Richard Huxton <dev@archonet.com>)
Список pgsql-performance
I'm converting a SQL application to PostgreSQL.  The majority of the logic
in this application is in the stored functions in the database.

Somewhere, I saw a reference to "WITH (iscachable)" for stored functions,
looking again, I'm unable to find any reference to this directive.  I have
a single function that is _obviously_ safe to cache using this, and it
generates no errors or problems that I can see.

Now I'm looking at a lot of other functions that, if cached, would speed
up performance considerably.  Yet I'm reluctant to use this directive
since I can't find documentation on it anywhere.

Can anyone say whether this is a supported feature in plpgsql, and is
safe to use?  Is it simply undocumented, or am I just looking in the
wrong place?

(to reduce ambiguity, the manner in which I'm using this is:

CREATE FUNCTION getconstant(VARCHAR)
RETURNS int
AS '
  DECLARE
  BEGIN
    IF $1 = ''phrase'' THEN
        RETURN 1;
    END IF;

    ...

  END;
' LANGUAGE 'plpgsql' WITH (iscacheable);


--
Bill Moran
Potential Technologies
http://www.potentialtech.com


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

Предыдущее
От: ohp@pyrenet.fr
Дата:
Сообщение: Re: Slow in morning hours
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: cacheable stored functions?