pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Michael Olivier <molivier@yahoo.com>
To: pgsql-sql postgresql.org <pgsql-sql@postgreSQL.org>
Subject: Re: [SQL] optimizing 2-table join w/millions of rows
Date: Sun, 22 Nov 1998 13:18:03 +0200
Message-ID: <l03110700b27da28b94ff@[147.233.159.109]> (raw)
In-Reply-To: <19981120022608.22274.rocketmail@send102.yahoomail.com>

At 4:26 +0200 on 20/11/98, Michael Olivier wrote:


>
> select U.acctname from usertest U, bgndtest B where
> 	B.part_needed=3 and B.loc_needed=5 and
> 	B.acctname=U.acctname and U.acctname in
> 		(select acctname from usertest where part=2 and loc=3)

Can you explain *verbally* what you meant to do here? It seems as if the
subselect is redundant. How about:

SELECT U.acctname
FROM   usertest U, bgndtest B
WHERE  B.acctname = U.acctname
  AND  B.part_needed=3 AND B.loc_needed=5
  AND  U.part=2 AND U.loc=3;

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma





view thread (6+ messages)  latest in thread

Message-ID: <l03110700b27da28b94ff@[147.233.159.109]>
Permalink:  ../l03110700b27da28b94ff@%5B147.233.159.109%5D/
Also on:    postgresql.org/message-id/l03110700b27da28b94ff@[147.233.159.109]

 · 

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: herouth@oumail.openu.ac.il, molivier@yahoo.com
  Subject: Re: [SQL] optimizing 2-table join w/millions of rows
  In-Reply-To: <l03110700b27da28b94ff@[147.233.159.109]>
  References: <19981120022608.22274.rocketmail@send102.yahoomail.com> <l03110700b27da28b94ff@[147.233.159.109]>

* 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