2 questions about volatile attribute of pg_proc.

Поиск
Список
Период
Сортировка
От Andy Fan
Тема 2 questions about volatile attribute of pg_proc.
Дата
Msg-id CAKU4AWp09TdpQzGo859MxvcYfiMvrMMjP2-R2EM=4JJELSFvgA@mail.gmail.com
обсуждение исходный текст
Ответы Re: 2 questions about volatile attribute of pg_proc.
Re: 2 questions about volatile attribute of pg_proc.
Список pgsql-hackers
Hi:

We know volatile is very harmful for optimizers and it is the default
value (and safest value) if the user doesn't provide that.  Asking user
to set the value is not a good experience,  is it possible to auto-generate
the value for it rather than use the volatile directly for user defined function. I
think it should be possible, we just need to scan the PlpgSQL_stmt to see if there
is a volatile function? 

The second question "It is v for “volatile” functions, whose results might change at any time.
(Use v also for functions with side-effects, so that calls to them cannot get optimized away.)"
I think they are different semantics.  One of the results is volatile functions can't be removed 
by remove_unused_subquery_output even if it doesn't have side effects. for example:
select b from (select an_expensive_random(), b from t);   Is it by design on purpose? 


--
Best Regards

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

Предыдущее
От: Andy Fan
Дата:
Сообщение: Consider parent's stats for set_append_rel_size.
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: 2 questions about volatile attribute of pg_proc.