Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Need assistance for tuning
Giridhar wrote:
> we have a query which takes 31 seconds when called through JDBC.
> The same sql statement, when executed from sqlplus takes only 1 second.
>
> When we took help of our dba to find out why it takes 31 seconds in
> production,
> our dba found that one table is undergoing full table scan when called
> from JDBC.
> This was also found from V$SQL_PLAN.
>
> However, explain plan shows index access and we get the output in just
> 1 second.
>
> How can we find out what is the reason for this discrepancy?
Bet you it's a bound variable.
If the optimiser knows the value of a variable it can do "clever stuff", whereas a plan for a query with deferred (bound) variable is a generic plan.
BugBear Received on Thu Aug 10 2006 - 06:58:39 CDT