Re: rules: evaluate inputs in advance

Поиск
Список
Период
Сортировка
От Markus Schiltknecht
Тема Re: rules: evaluate inputs in advance
Дата
Msg-id 1147586499.4851.8.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: rules: evaluate inputs in advance  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: rules: evaluate inputs in advance  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Hi Martijn,

On Fri, 2006-05-12 at 18:05 +0200, Martijn van Oosterhout wrote:
> But it can't really. In the example that started this thread, there are
> two seperate rules and after rewriting the executor will be presented
> two seperate queries.

Ah, thank you, that explains the difficulties with rules.

> What you probably want is a function that is given the row and then
> executes the two statements on a per row basis. This has the effect you
> want but gives up the major benefit of rules, wholesale query
> restructuring like views which allows the executor to find better
> plans. The executor can't see inside a trigger so it can't optimise.

Isn't that an argument for keeping rewrite rules instead of using
something trigger like for updatable views? Wouldn't it be feasible to
teach the executor how to handle multiple queries with some
pre-evaluated input?

Regards

Markus



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

Предыдущее
От: "Ed L."
Дата:
Сообщение: pg_dump index/constraint creation order
Следующее
От: Lincoln Yeoh
Дата:
Сообщение: Re: [PERFORM] Arguments Pro/Contra Software Raid