Re: Coalesce bug ?

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Coalesce bug ?
Дата
Msg-id 00ab01cddf9b$c2b466a0$481d33e0$@yahoo.com
обсуждение исходный текст
Ответ на Re: Coalesce bug ?  (Chris Angelico <rosuav@gmail.com>)
Ответы Re: Coalesce bug ?
Список pgsql-general
> Something to consider: Since you've told Postgres that your function is
> immutable, it might be remembering the result from the first execution and
> using it in the second. Try restarting the server between the EXPLAIN and
the
> test.
>

Now that you've said this as well (hopefully you are not just repeating
me)...

Is this even possible or does an IMMUTABLE function has get evaluated at
least one time per query?  From Tom's comments I am assuming that, per plan,
at minimum the planner will execute a function with constant literals one
time and simply reuse the results.  It does not sound as if a function with
"field sourced values" will ever be "cached".  Futhermore, even if a
function is always called with the same constants the caching mechanism does
not cross the statement boundary (not even to the transaction level let
alone global).

> By the way, why do you declare your functions as "STRICT IMMUTABLE"
> and "STRICT VOLATILE"?

Is this a question about the layout of the commands spatially?

David J.



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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Coalesce bug ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Coalesce bug ?