Re: [GENERAL] Simulating an outer join
От | Bruce Momjian |
---|---|
Тема | Re: [GENERAL] Simulating an outer join |
Дата | |
Msg-id | 200001122100.QAA14618@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: [GENERAL] Simulating an outer join (Sarah Officer <officers@aries.tucson.saic.com>) |
Список | pgsql-general |
> Can somebody comment on using EXISTS vs. IN in a subselect? I have > some statements with subselects, and I'd like to understand the > ramifications of choosing EXISTS or IN. We have some brain-damaged code that is faster with EXISTS than IN. With IN, the subquery is evaluated and the result put in a temp relation. Every test for IN sequentially scans the subquery result looking for a match. EXISTS uses an index on the subquery result. Not sure why we can't just fix this, but I don't understand enough to know the reason. People who do understand say there is no good solution until we redesign the query tree in 7.1. -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
В списке pgsql-general по дате отправления: