| От | Andreas Pflug |
|---|---|
| Тема | inefficient query plan with left joined view |
| Дата | |
| Msg-id | 3E36B4F2.1020506@web.de обсуждение исходный текст |
| Ответы |
Re: inefficient query plan with left joined view
|
| Список | pgsql-performance |
What I'm doing on V7.3.1: select t1.keycol, t2.keycol from tab1 t1 LEFT join myview t2 on t1.keycol=t2.keycol where t1.keycol=1000001 t1 has 100 rows, t2 has 4000, both with keycol as PK. the view is created as CREATE myview AS SELECT keycol, 22::integer as calc_col FROM tab2 The query plan will show an ugly subquery scan on all tab2 rows. If the view is created without calculated columns, the query plan looks as expected showing and index scan on tab2 with the correct condition, inner join will always be ok. In real life, the view consists of a lot more tables, and the tables may contain >1,000,000 rows so you may imagine the performance...
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера