Re: Early WIP/PoC for inlining CTEs

Поиск
Список
Период
Сортировка
От Nico Williams
Тема Re: Early WIP/PoC for inlining CTEs
Дата
Msg-id 20180725153205.GM5695@localhost
обсуждение исходный текст
Ответ на Re: Early WIP/PoC for inlining CTEs  (David Fetter <david@fetter.org>)
Ответы Re: Early WIP/PoC for inlining CTEs  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-hackers
On Wed, Jul 25, 2018 at 07:42:37AM +0200, David Fetter wrote:
> Please find attached a version rebased atop 167075be3ab1547e18 with
> what I believe are appropriate changes to regression test output.  The
> other changes to the regression tests output are somewhat puzzling, as
> they change the actual results of queries.  I've also attached both
> the "leftover" diff and the files to which it should be applied.

I think the SQL programmer needs some control over whether a CTE is:

 - a materialized view -- and therefore a barrier
 - a view (which can then be inlined by the optimizer)

It is possible to add a keyword for this purpose in the WITH syntax:

    WITH   VIEW (...) AS a_view
         , MATERIALIZED VIEW (...) AS a_barrier
    ...;

This would be a lot like creating TEMP views, but without the catalog
overhead.

(I wonder how hard it would be to partiion the OID namespace into
temp/persistent ranges so that temp schema elements need not be written
into the catalog.)

Nico
-- 


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Missing pg_control crashes postmaster
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Missing pg_control crashes postmaster