Re: IN surpasses NOT EXISTS in 7.4RC2 ??

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: IN surpasses NOT EXISTS in 7.4RC2 ??
Дата
Msg-id 26331.1068736791@sss.pgh.pa.us
обсуждение исходный текст
Ответ на IN surpasses NOT EXISTS in 7.4RC2 ??  (Rajesh Kumar Mallah <mallah@trade-india.com>)
Ответы Re: IN surpasses NOT EXISTS in 7.4RC2 ??  (Rajesh Kumar Mallah <mallah@trade-india.com>)
Список pgsql-performance
Rajesh Kumar Mallah <mallah@trade-india.com> writes:
> NOT EXISTS is taking almost double time than NOT IN .
> I know IN has been optimised in 7.4 but is anything
> wrong with the NOT EXISTS?

That's the expected behavior in 7.4.  EXISTS in the style you are using
it effectively forces a nestloop-with-inner-indexscan implementation.
As of 7.4, IN can do that, but it can do several other things too,
including the hash-type plan you have here.  So assuming that the
planner chooses the right plan choice (not always a given ;-))
IN should be as fast or faster than EXISTS in all cases.

            regards, tom lane

В списке pgsql-performance по дате отправления:

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: performance optimzations
Следующее
От: Robert Treat
Дата:
Сообщение: Re: Value of Quad vs. Dual Processor machine