Re: [HACKERS] CTE inlining
От | David Rowley |
---|---|
Тема | Re: [HACKERS] CTE inlining |
Дата | |
Msg-id | CAKJS1f8ma3icER32g8HM33Rp4mTp90Ucv8q0CkitY3s6EE20aw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] CTE inlining (Bruce Momjian <bruce@momjian.us>) |
Список | pgsql-hackers |
On 13 May 2017 at 08:39, Bruce Momjian <bruce@momjian.us> wrote: > To summarize, it seems we have two options if we want to add fence > control to CTEs: > > 1. add INLINE to disable the CTE fence > 2. add MATERIALIZE to enable the CTE fence I think #1 is out of the question. What would we do in cases like: WITH INLINE cte AS (SELECT random() a) SELECT * FROM cte UNION SELECT * FROM cte; I assume we won't want to inline when the CTE query contains a volatile function, and we certainly won't in cases like: WITH INLINE cte AS (DELETE FROM a RETURNING *) INSERT INTO b SELECT * from cte WHERE cte.value > 5; We'd be certain to receive complaints from disgruntled users about "Why is this not inlined when I specified INLINE?" #2 does not suffer from that. -- David Rowley http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления: