Re: Invalid optimization of VOLATILE function in WHERE clause?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Invalid optimization of VOLATILE function in WHERE clause?
Дата
Msg-id CAHyXU0xRTBk2w7epr1LEyVmQX41+KhNCScgmZVZZD6CX3rJnyw@mail.gmail.com
обсуждение исходный текст
Ответ на Invalid optimization of VOLATILE function in WHERE clause?  (Florian.Schoppmann@emc.com (Florian Schoppmann))
Список pgsql-hackers
On Thu, Sep 20, 2012 at 9:24 AM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Merlin Moncure <mmoncure@gmail.com> wrote:
>
>> Hm, I bet it's possible (although probably not easy) to deduce
>> volatility from the function body...maybe through the validator.
>> If you could do that (perhaps warning in cases where you can't),
>> then the performance regression-inducing-argument (which I agree
>> with) becomes greatly ameliorated.
>
> For about the last 10 years the Wisconsin Courts have been parsing
> SQL code to generate Java query classes, including "stored
> procedures", and determining information like this.  For example, we
> set a readOnly property for the query class by examining the
> statements in the procedure and the readOnly status of each called
> procedure.  It wasn't that hard for us, and I'm not sure what would
> make much it harder in PostgreSQL, if we can do it where a parse
> tree for the function is handy.

hm, what do you do about 'after the fact' changes to things the
procedure body is pointing to?  what would the server have to do?

merlin



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: XLogInsert scaling, revisited
Следующее
От: Andres Freund
Дата:
Сообщение: Re: XLogInsert scaling, revisited