IN, EXISTS or ANY?

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: IN, EXISTS or ANY?
Date: 2002-04-29 04:44:55
Message-ID: web-1387383@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Folks,

I was wondering if there is any difference in execution speed for the
following three statements:

WHERE case_id IN (SELECT case_id FROM case_clients
WHERE matter_no = '123.122342');
or:

WHERE case_id = ANY (SELECT case_id FROM case_clients
WHERE matter_no = '123.122342');
or

WHERE EXISTS ( SELECT case_id FROM case_clients
WHERE matter_no = '123.122342'
AND case_id = cases.case_id);

... or does the parser handle all three exactly the same way?

-Josh Berkus

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-04-29 04:54:23 Re: IN, EXISTS or ANY?
Previous Message Joseph Barillari 2002-04-29 00:56:23 Casting dates