Performance Difference Between != and <>?

  • From: "Scott Canaan" <srcdco@xxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 22 Sep 2006 16:20:22 -0400

  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 on Solaris 10, 64-bit.


Thank you,


Scott Canaan '88 (Scott.Canaan@xxxxxxx)

(585) 475-7886

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


Other related posts: