| От | Vadim Mikheev |
|---|---|
| Тема | Re: [HACKERS] Subqueries and indexes |
| Дата | |
| Msg-id | 36F06628.C40D1FC0@krs.ru обсуждение исходный текст |
| Ответ на | Re: [HACKERS] Subqueries and indexes (Bruce Momjian <maillist@candle.pha.pa.us>) |
| Список | pgsql-hackers |
Bruce Momjian wrote: > > > > > While the index usage is good, the fact is the subquery is executed for > > every row of markmain, isn't it? That's one query executed for each row > > in markmain, isn't it? > > I just tried this with NOT EXISTS, and it was VERY fast. Can we discuss > the issues, and perhaps auto-rewrite these as exists. Is that always > better than hash? Not always, but there is no hashing currently, so you could try re-writing for IN/NOT IN subqueries without aggregates... Keep in mind that expression subqueries must return <= 1 rows, so it's probably better don't rewrite them (or you'll have to add this check to EXISTS code). Vadim
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера