Re: BUG #17721: A completely unused CTE negatively affect Query Plan
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #17721: A completely unused CTE negatively affect Query Plan |
| Дата | |
| Msg-id | 2784036.1671042328@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 |
PG Bug reporting form <noreply@postgresql.org> writes:
> I've boiled down an issue we have in production to a simple query that can
> demonstrate it. I've run this on 13,14 and 15 locally in a docker container
> with the same results. If a CTE that is completely unexecuted exists in a
> subquery (or view in our production case) it affects the query plan VERY
> negatively. The first explain shows a sequential scan, where the second
> explain shows an index scan, just by the existence of the (obviously)
> unexecuted CTE.
The presence of the CTE prevents flattening of the subquery.
If you don't like it, don't attach the CTE right there.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера