Re: WITH NOT MATERIALIZED and DML CTEs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WITH NOT MATERIALIZED and DML CTEs
Дата
Msg-id 26493.1559604815@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WITH NOT MATERIALIZED and DML CTEs  (David Fetter <david@fetter.org>)
Ответы Re: WITH NOT MATERIALIZED and DML CTEs  (David Fetter <david@fetter.org>)
Список pgsql-hackers
David Fetter <david@fetter.org> writes:
> It might be worth documenting the fact that NOT MATERIALIZED doesn't
> affect DML CTEs, just as it doesn't affect statements with volatile
> functions and recursive CTEs.

We already do:

    However, if a WITH query is non-recursive and side-effect-free (that
    is, it is a SELECT containing no volatile functions) then it can be
    folded into the parent query, allowing joint optimization of the two
    query levels. By default, this happens if the parent query references
    the WITH query just once, but not if it references the WITH query more
    than once. You can override that decision by specifying MATERIALIZED
    to force separate calculation of the WITH query, or by specifying NOT
    MATERIALIZED to force it to be merged into the parent query. The
    latter choice risks duplicate computation of the WITH query, but it
    can still give a net savings if each usage of the WITH query needs
    only a small part of the WITH query's full output.

            regards, tom lane



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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: WITH NOT MATERIALIZED and DML CTEs
Следующее
От: Ashwin Agrawal
Дата:
Сообщение: Re: Confusing error message for REINDEX TABLE CONCURRENTLY