Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> SQL Performance Optimization

SQL Performance Optimization

From: Joachim Zobel <jzobel_at_my-dejanews.com>
Date: Sat, 14 Oct 2000 06:16:17 GMT
Message-ID: <39eb1dfb.2348927@dilbert.crrrwg.de>

Hi.

I have to SELECTs, both returning a key column in their result set. What I want is a join/intersection of both. The first result set is rather large, nonunique and comes from an expensive query so i want to avoid any sorting. The second ist just a SELECT ID FROM TABLE where the TABLE has an unique index.

I want to get the first rows ASAP.

The best strategy to get what i want is probaby to run along the first result set and to do lookups into the second table to see if the id is in it and to set a "have seen it flag". If I look up the same entry a second time I behave as if it is not there. This way i would get uniqueness without sorting.

This looks like a very unSELECTish strategy. Is there any way to write a SELECT that uses it (on 8.0.5).

Thanx,
Joachim

-- 
SELECT COUNT(1) FROM HIMMELSZELT.STERNE;

Althoug this message has a valid From header, replies 
to user_at_netcologne.de where user = nc-zobeljo are preferred.
Received on Sat Oct 14 2000 - 01:16:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US