IN, EXISTS or ANY? - Mailing list pgsql-sql

From Josh Berkus
Subject IN, EXISTS or ANY?
Date
Msg-id web-1387383@davinci.ethosmedia.com
Whole thread Raw
Responses Re: IN, EXISTS or ANY?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-sql by date:

Previous
From: Joseph Barillari
Date:
Subject: Casting dates
Next
From: Tom Lane
Date:
Subject: Re: IN, EXISTS or ANY?