| От | Mike Mascari |
|---|---|
| Тема | Re: Avoiding sequential scans with OR join condition |
| Дата | |
| Msg-id | 4172193D.8030202@mascari.com обсуждение исходный текст |
| Ответ на | Re: Avoiding sequential scans with OR join condition (Sim Zacks <sim@compulab.co.il>) |
| Ответы |
Re: Avoiding sequential scans with OR join condition
|
| Список | pgsql-general |
Sim Zacks wrote: > I would use 2 left joins and use the where condition to make sure one > of them is true, such as: > > select big_table.* from > big_table left join little_table as l1 on big_table.y1=l1.y and > l1.x=10 > left join little_table as l2 on big_table.y2=l2.y and l1.x=10 > where l1.p_key is not null and l2.p_key is not null > > I have never tried this in postgresql, but in my experience with > various other DB engines it is a lot faster then using an or in the > join and faster then a union. Wow! Thanks! That certainly did the trick. Mike Mascari
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера