Re: [HACKERS] CTE inlining

Поиск
Список
Период
Сортировка
От Claudio Freire
Тема Re: [HACKERS] CTE inlining
Дата
Msg-id CAGTBQpb0196WWCLHTUzqZUFy5s-ayRptQD=nGVyrw3vEyWHamg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] CTE inlining  (Craig Ringer <craig@2ndquadrant.com>)
Ответы Re: [HACKERS] CTE inlining  (David Fetter <david@fetter.org>)
Список pgsql-hackers
On Wed, May 3, 2017 at 2:19 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
>> Or we will choose WITH MATERIALIZE, and then the users aware of the fencing
>> (and using the CTEs for that purpose) will have to modify the queries. But
>> does adding MATERIALIZE quality as major query rewrite?
>
> Hardly.
>
>> Perhaps combining this with a GUC would be a solution. I mean, a GUC
>> specifying the default behavior, and then INLINE / MATERIALIZE for
>> individual CTEs in a query?
>
> It'd be nice if we could do that for a couple of releases as an
> interim measure, but people will then get locked into relying on it,
> and we'll never be able to remove it.

The proposed guc seems like a good idea, without which ORMs that
support CTEs would be at a loss. People using those ORMs that need
materialized behavior would have to wait for the ORM to catch up with
postgres syntax before upgrading, and that wouldn't be a nice thing.

It's not about requiring testing before upgrading, of course users
should/will do that. But if said testing says inlined CTEs perform
horribly, and the ORM has no support for the materialized keyword, the
only option is to not upgrade. With the CTE, people can upgrade,
changing the default behavior back to what it was.

That seems to me a useful thing to have.



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

Предыдущее
От: Michael Banck
Дата:
Сообщение: Re: [HACKERS] [PostgreSQL 10] default of hot_standby should be "on"?
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [HACKERS] check with serial