pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ross J. Reedstrom <reedstrm@rice.edu>
To: pgsql-sql@postgresql.org
Subject: Re: optimize sql
Date: Wed, 26 Jul 2000 10:51:07 -0500
Message-ID: <20000726105107.A19381@rice.edu> (raw)
In-Reply-To: <fc.000f567200599eab000f567200599eab.599ef1@fc.emc.com.ph>
References: <fc.000f567200599eab000f567200599eab.599ef1@fc.emc.com.ph>

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@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005



view thread (2+ messages)

Message-ID: <20000726105107.A19381@rice.edu>
Permalink:  ../20000726105107.A19381@rice.edu/
Also on:    postgresql.org/message-id/20000726105107.A19381@rice.edu

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: reedstrm@rice.edu
  Subject: Re: optimize sql
  In-Reply-To: <20000726105107.A19381@rice.edu>
  References: <fc.000f567200599eab000f567200599eab.599ef1@fc.emc.com.ph> <20000726105107.A19381@rice.edu>

* 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