Re: BUG #17721: A completely unused CTE negatively affect Query Plan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17721: A completely unused CTE negatively affect Query Plan
Дата
Msg-id 2998993.1671058060@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #17721: A completely unused CTE negatively affect Query Plan  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17721: A completely unused CTE negatively affect Query Plan
Список pgsql-bugs
Nathaniel Hazelton <nathaniel@sturdyai.com> writes:
> The CTE in that location was emulating a view in which we have a CTE -
> which responds the same way.  Does this mean CTEs can never be used in
> views that could be flattened without affecting performance?

You've got a view with an unused CTE?  Why?

But at any rate, yes, the presence of a CTE is an optimization
fence: we can't flatten the subquery containing it without losing
the query level at which the CTE should be evaluated.  Perhaps there
are special cases where that could be relaxed, but nobody's tried
very hard.

            regards, tom lane



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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: BUG #17720: pg_dump creates a dump with primary key that cannot be restored, when specifying 'using index ...'
Следующее
От: Alex Richman
Дата:
Сообщение: Segfault while creating logical replication slots on active DB 14.6-1 + 15.1-1