| От | Tom Lane |
|---|---|
| Тема | Re: Too slow |
| Дата | |
| Msg-id | 11070.1111518881@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Too slow ("Chris Hoover" <revoohc@sermonaudio.com>) |
| Список | pgsql-admin |
"Chris Hoover" <revoohc@sermonaudio.com> writes:
> The "not in (subselect)" is very slow in postgresql.
It's OK as long as the subselect result is small enough to hash, but
with 5500000 rows that's not going to happen :-(.
Another issue is that if there are any NULLs in the subselect then you
will probably not like the results. They are correct per spec but not
very intuitive.
Personally I'd try ye olde outer join trick:
select partes.*
from partes left join sujetos on (identificacion = cedula)
where cedula is null;
A merge join on this would likely be the most effective solution.
regards, tom lane
В списке pgsql-admin по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера