Skip site navigation (1) Skip section navigation (2)

Re: optimize sql

From: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: optimize sql
Date: 2000-07-26 15:51:07
Message-ID: 20000726105107.A19381@rice.edu (view raw or flat)
Thread:
Lists: pgsql-sql
On Wed, Jul 26, 2000 at 10:11:15PM +0800, pgsql-sql wrote:
> HI!
> 
> The SQL below is too slow.
> 
> SELECT name FROM office, office_application 
> WHERE code = office_code 
> AND name NOT IN
> (SELECT DISTINCT name FROM office, office_application
> WHERE active = 't' AND code = office_code);
> 

How does the output of the above differ from:

SELECT name FROM office, office_application 
WHERE code = office_code 
AND active != 't';

Without knowing the table structures (which tables to active, code, 
and office_code belong to?) it's hard to suggest much else.

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005

In response to

pgsql-sql by date

Next:From: pgsql-sqlDate: 2000-07-27 02:40:04
Subject: Re(2): optimize sql
Previous:From: pgsql-sqlDate: 2000-07-26 14:11:15
Subject: optimize sql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group