Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> IN Clause or OR conditions..
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
![]() |
![]() |