IN, EXISTS or ANY?
Josh Berkus <josh@agliodbs.com>
From: "Josh Berkus" <josh@agliodbs.com>
To: pgsql-sql@postgresql.org
Date: 2002-04-29T04:44:55Z
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