Re: SOLVED - RE: Poor performance using CTE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SOLVED - RE: Poor performance using CTE
Дата
Msg-id 1159.1352943074@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: SOLVED - RE: Poor performance using CTE  (Craig Ringer <craig@2ndQuadrant.com>)
Список pgsql-performance
Craig Ringer <craig@2ndQuadrant.com> writes:
> I was looking through the latest spec drafts I have access to and
> couldn't find any reference to Pg's optimisation-fence-for-CTEs
> behaviour being required by the standard, though I've repeatedly seen it
> said that there is such a requirement.

I don't believe it's required by the standard (it's hard to see how it
could be, when query optimization is a topic outside the spec to start
with).  However, we allow INSERT/UPDATE/DELETE RETURNING inside WITH,
and for those I think you really need to treat WITH as an optimization
fence.  It's a lot more debatable for SELECT; there are some advantages
to providing a fence this way but there are definitely downsides too.
I could see adjusting that definition in the future, as we get more
experience with use of CTEs.

            regards, tom lane


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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: SOLVED - RE: Poor performance using CTE
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: SOLVED - RE: Poor performance using CTE