| От | Tom Lane |
|---|---|
| Тема | Re: joining views |
| Дата | |
| Msg-id | 982.1035383478@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | joining views (Tomasz Myrta <jasiek@klaster.net>) |
| Список | pgsql-performance |
Tomasz Myrta <jasiek@klaster.net> writes:
> I'd like to split queries into views, but I can't join them - planner
> search all of records instead of using index. It works very slow.
I think this is the same issue that Stephan identified in his response
to your other posting ("sub-select with aggregate"). When you write
FROM x join y using (col) WHERE x.col = const
the WHERE-restriction is only applied to x. I'm afraid you'll need
to write
FROM x join y using (col) WHERE x.col = const AND y.col = const
Ideally you should be able to write just
FROM x join y using (col) WHERE col = const
but I think that will be taken the same as "x.col = const" :-(
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера