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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: CONSISTANT GETS

RE: CONSISTANT GETS

From: Whittle Jerome Contr NCI <Jerome.Whittle_at_scott.af.mil>
Date: Fri, 15 Nov 2002 11:34:22 -0800
Message-ID: <F001.00504A13.20021115113422@fatcity.com>


Jared,

I'm still on 7.3.4 but I'm sure that you are right about the WHERE clause in this case. It went from an INDEX FULL SCAN to an INDEX UNIQUE SCAN on the same index once the blasted concatenations were removed. One programmer says he likes to write it that way because it's simpler and nicer looking!

Still I've seen some nice speed gains when just converting some WHERE statements from NOT IN to NOT EXISTS.

YMMV Jerry Whittle
ACIFICS DBA
NCI Information Systems Inc.
jerome.whittle_at_scott.af.mil
618-622-4145

> -----Original Message-----
> From: Jared.Still_at_radisys.com [SMTP:Jared.Still_at_radisys.com]
>
> Jerry,
>
> I suspect that the improvments are more likely due to your
> rewriting the WHERE clause rather than the use of NOT EXISTS.
>
> Especially if the database were 9i, where NOT IN actually
> seems get a better execution path than NOT EXISTS.
>
> That original WHERE clause is really a piece of work.
>
> Jared
>
> "Whittle Jerome Contr NCI" <Jerome.Whittle_at_scott.af.mil>
>
> I've seen worse. My programmers don't know how to use NOT EXISTS even
> though I've explained it many times. And that's the least of my problems.
> Look at this mess:
> SELECT *
> FROM sar.pax_header_suspense_err_temp
> WHERE manifest_type
> || manifesting_station
> || fiscal_year
> || manifest_serial_number NOT IN (
> SELECT manifest_type
> || manifesting_station
> || fiscal_year
> || manifest_serial_number
> FROM manifest_serial_number_history)
>
> Takes over an hour to run. I rewrote it as such:
> SELECT *
> FROM sar.pax_header_suspense_err_temp t
> WHERE NOT EXISTS
> (SELECT 'X'
> FROM manifest_serial_number_history h
> WHERE
> t.manifest_type = h.manifest_type and
> t.manifesting_station = h.manifesting_station and
> t.fiscal_year = h.fiscal_year and
> t.manifest_serial_number = h.manifest_serial_number )
>
> Under a second.
>
> Jerry Whittle
> ACIFICS DBA
> NCI Information Systems Inc.
> jerome.whittle_at_scott.af.mil
> 618-622-4145
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Whittle Jerome Contr NCI
  INET: Jerome.Whittle_at_scott.af.mil

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Nov 15 2002 - 13:34:22 CST

Original text of this message

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