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 -> IN Clause or OR conditions..

IN Clause or OR conditions..

From: <magendranjsathaiah_at_gmail.com>
Date: 11 Oct 2006 00:23:34 -0700
Message-ID: <1160551414.514243.187330@i42g2000cwa.googlegroups.com>


Hello,

I have question which might sound very basic but i could not help seeking out help

we have database about 5000 recs in oracle 8i - with an index on the entity_id which is the PK.

when we fire queries like the below, they take about 10 secs

select col1, col2 from table where entity_id IN

(...............................) or entity_id IN (.............)

select col1, col2 from table where entity_id = 1 OR entity_id = 2 OR .......... OR entity_id = 4999

But if just fire the query without any where clause it takes just 0.2 secs like

select col1, col2 from table

then i write my java code to apply the fiilter, everything works out within 0.4 secs whereas it took about 10 secs when fire the query with such a huge filter criteria...

Where is the problem now, is it with data, index, huge filter criteria or any database configuration that makes the it 10 secs? (Can the query or database itself be tuned)

Any idea?? Received on Wed Oct 11 2006 - 02:23:34 CDT

Original text of this message

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