From: Josh Berkus <josh@agliodbs.com>
To: pgsql-sql@postgresql.org
Subject: IN, EXISTS or ANY?
Date: Sun, 28 Apr 2002 21:44:55 -0700
Message-ID: <web-1387383@davinci.ethosmedia.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com
Subject: Re: IN, EXISTS or ANY?
In-Reply-To: <web-1387383@davinci.ethosmedia.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox