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

Re: IN Clause or OR conditions..

From: Jerome Vitalis <vitalismanREMOVETHAT_at_gmail.com>
Date: Wed, 11 Oct 2006 10:55:51 +0200
Message-ID: <452cb182$0$29367$426a74cc@news.free.fr>


magendranjsathaiah_at_gmail.com wrote:
> 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??
>

Are your statistics for this table and this index up to date?

Post the execution plan for your query. Or at least the *real* code (the code of your query and the code of the table and index creations.) Received on Wed Oct 11 2006 - 03:55:51 CDT

Original text of this message

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