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: query taking long time from java code

Re: query taking long time from java code

From: Frank Langelage <frank_at_lafr.de>
Date: Sat, 26 Aug 2006 23:10:34 +0200
Message-ID: <4lbrmbF1416hU1@individual.net>


palak123i_at_gmail.com wrote:
> Hi,
> Thanks for the reply. I will try this out. However I am not using
> pagination. I am trying to get a product list from database which has
> got 15+ million records. And the number of rows returned from the
> search are only 5-10...
> Thanks,
> Palak.
>

Get the execution plans and find out the difference. If you show us the query and the indexes of the table(s) we may be able to help you.
To get 5-10 rows out of ~15 million you must have a very selective index on that table. Is the data distribution for the first column of that index even or not?

If you e.g. have a table with a column with an very uneven distribution

   oracle may choose a full table scan if you use host variables in your statement.
You said you are using a prepared statement, so you probably do use host variables.
Typing in the statement in toad with literals does not use host variables and can choose the execution plan based on the given values. Received on Sat Aug 26 2006 - 16:10:34 CDT

Original text of this message

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