Re: Static functions
От | Joseph S |
---|---|
Тема | Re: Static functions |
Дата | |
Msg-id | gc91qp$2d24$1@news.hub.org обсуждение исходный текст |
Ответ на | Re: Static functions (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Static functions
|
Список | pgsql-general |
Tom Lane wrote: > "Gurjeet Singh" <singh.gurjeet@gmail.com> writes: >> Shouldn't PG make all efforts to not execute something when the result is >> already known? > > Not if said effort would cost more than is saved, which would be by far > the most likely result if we tried to cache all function results. > > regards, tom lane > In this case, with the function being called over and over again inside a nested loop, it would be worth the effort. I'm not even talking about caching the result for the whole transaction block, just replacing the function call before continuing the query. Perhaps I can get around this problem by creating a temp table inside the function that is dropped on transaction commit.
В списке pgsql-general по дате отправления: