Re: Re: Does PostgreSQL support EXISTS?
| От | Bruce Momjian |
|---|---|
| Тема | Re: Re: Does PostgreSQL support EXISTS? |
| Дата | |
| Msg-id | 200106131403.f5DE3wE03678@candle.pha.pa.us обсуждение исходный текст |
| Ответ на | RE: Re: Does PostgreSQL support EXISTS? ("Erick Papadakis" <erick_papadakis@yahoo.com>) |
| Список | pgsql-general |
> | On postgres at least, exists is faster than in. > | > | They are equivalent though. > | > | select x from a where v in (select v from b) > | select x from a where exists (select 1 from b where a.v = b.v) > | select x from a, b where a.v = b.v > | > | are all the same. Postgres doesn't quite know that yet though. > > > If you do an EXPLAIN on Oracle with the first 2 queries above, you will > notice that the second one is faster in Oracle too (i.e., EXISTS is faster > than IN). So it is confirmed. Interesting. -- 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, Pennsylvania 19026
В списке pgsql-general по дате отправления: