Re: IN or EXISTS?? faster one

Поиск
Список
Период
Сортировка
От Lucky Leavell
Тема Re: IN or EXISTS?? faster one
Дата
Msg-id Pine.UW2.4.21.0212201908100.11097-100000@ris7.UniXpress.com
обсуждение исходный текст
Ответ на IN or EXISTS?? faster one  ("Prachi Jain" <prachijain3@rediffmail.com>)
Список pgsql-general

On 19 Dec 2002, Prachi Jain wrote:

> Hello All,
>
> I am using too many subqueries in my queries. I have read some
> FAQs that using EXISTS is faster than IN. Is that correct??

In general, with any RDBMS, the EXISTS construct is faster because the
subselect need only the first row to satisfy the condition whereas IN must
return all rows from the subselect.  (Of course, the query optimizer must
take advantage of that fact ...)

(I am rather new to PostgrSQL but an old hand - in more ways than one <G>-
with commercial Ingres.)

Lucky Leavell


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: table schema causes crash
Следующее
От:
Дата:
Сообщение: Re: table schema causes crash