Re: EXISTS Keyword

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: EXISTS Keyword
Дата
Msg-id 200110040159.f941xio07679@candle.pha.pa.us
обсуждение исходный текст
Ответ на EXISTS Keyword  (<cnliou@eurosport.com>)
Список pgsql-sql
> Hello!
> 
> I vaguely remember that someone said somewhere that
> EXISTS runs faster than IN:
> 
> SELECT * FROM table1 where field1 EXISTS (SELECT
> field4 FROM table2)

Move field1 into the subquery and join it to table2.  See the FAQ for an
example.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: SubQuery
Следующее
От: "Advid@newgen"
Дата:
Сообщение: maximum parameters limit to function & manipulating array in plpgsql