Re: ...WHERE TRUE" condition in union results in bad query pla
В списке pgsql-performance по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: ...WHERE TRUE" condition in union results in bad query pla |
| Дата | |
| Msg-id | 1857.1330830209@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | ...WHERE TRUE" condition in union results in bad query pla (Claus Stadler <cstadler@informatik.uni-leipzig.de>) |
| Ответы |
Re: ...WHERE TRUE" condition in union results in bad query pla
|
| Список | pgsql-performance |
Claus Stadler <cstadler@informatik.uni-leipzig.de> writes:
> Query optimizer glitch: "...WHERE TRUE" condition in union results in
> bad query plan ...
Yeah, this is because a nonempty WHERE clause defeats simplifying the
UNION ALL into a simple "append relation" (cf is_safe_append_member()).
The planner will eventually figure out that WHERE TRUE is a no-op,
but that doesn't happen till later (and there are good reasons to do
things in that order).
Sooner or later I'd like to relax the restriction that appendrel members
can't have extra WHERE clauses, but don't hold your breath waiting...
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера