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: Performance Difference Between != and <>?

RE: Performance Difference Between != and <>?

From: Binh Pham <binhpham15_at_hotmail.com>
Date: Sun, 24 Sep 2006 19:34:13 +0000
Message-ID: <BAY103-F258A70AACE92FB8006A601D2270@phx.gbl>

Do the explain plans look the same? Same costs?


From: "Mark W. Farnham" <mwf@rsiz.com>
Reply-To: mwf@rsiz.com
To: <srcdco@rit.edu>, <oracle-l@freelists.org>
Subject: RE: Performance Difference Between != and <>?
Date: Sun, 24 Sep 2006 12:44:58 -0400

Iím pretty sure the lexical parse converts either != to <> or <> to !=, but Iím not sure whether that affects whether the sql text will match a stored outline.

 

The original text is preserved in the sql text area, so maybe that is it. Otherwise I am mystified.

 


From: oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.org] On Behalf Of Scott Canaan
Sent: Friday, September 22, 2006 4:20 PM
To: oracle-l@freelists.org
Subject: Performance Difference Between != and <>?

 

  Does anyone know why thereís a big performance difference when using != vs. <>?  I was just looking at a query that was written both ways and there is a big difference in how long it takes to return data.  The query is:

 

Select count(*) from claws_doc_table where claws_doc_id = :id and exists (select 1 from claws_person_id where status != 0);

 

If you use !=, it returns sub-second.  If you use <>, it takes 7 seconds to return.  Both return the right answer.  Iíve looked in the Oracle documentation and canít find anything that would explain this.  The documentation says that they are interchangeable.

 

We are running Oracle 10.2.0.2 on Solaris 10, 64-bit.

 

Thank you,

 

Scott Canaan '88 (Scott.Canaan@rit.edu)

(585) 475-7886

"Life is like a sewer, what you get out of it depends on what you put into it." - Tom Lehrer.

 


-- http://www.freelists.org/webpage/oracle-l Received on Sun Sep 24 2006 - 14:34:13 CDT

Original text of this message

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