From: Josh Berkus <josh@agliodbs.com>
To: sqllist <pgsql-sql@postgresql.org>
Subject: Re: Query Problem
Date: Thu, 26 Oct 2000 10:55:06 -0700
Message-ID: <39F86FFA.A1499290@agliodbs.com> (raw)
References: <7F124BC48D56D411812500D0B74725140614B4@fileserver002.intecsystems.co.uk>
Michael,
> SELECT Data
> FROM Table A
> WHERE NOT EXISTS (
> SELECT * FROM Table_B, Table_C
> WHERE Table_B.GroupID = TableC.GroupID
> AND TableC.AccountID = 11
> )
>
> I think that the not exists is a bit quicker than the NOT IN. Give it
> a whirl.
A *lot* faster. Like, 7x as fast. I'd forgotten about EXISTS, since I
so seldom have a use for it ... but this is shy it was created, I guess.
Thanks so much for your help!
-Josh Berkus
--
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 436-9166
for law firms, small businesses fax 436-0137
and non-profit organizations. pager 338-4078
San Francisco
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: Query Problem
In-Reply-To: <39F86FFA.A1499290@agliodbs.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