Re: Bind Variable - Query slow
Date: Fri, 23 Mar 2012 09:18:48 +0000
I've seen this happen before - the culprit was hibernate/JDBC passing in a value as a an NVARCHAR2 instead of a VARCHAR2 - I had to create a functional index (TO_NCHAR) as a workaround.
Have a look in dba_hist_sql_bind_metadata & check what type Oracle thinks the bind variable is.
On Fri, Mar 23, 2012 at 5:53 AM, GovindanK <gkatteri_at_gmail.com> wrote:
> Linux RAC ,188.8.131.52
> Query runs fast with hard coding / SQL*Plus '&' ; But when run through the
> application using bind variables , the plan is different and it goes for
> MERGE CARTESIAN JOIN. Metalink , google , underscore parameters are not of
> much help. Tried different bucket sizes with statistics ; Tried rewriting
> the query; Marginal improvement ; If you hard code or with SQL*Plus '&' the
> query runs in 1 second .. but with bind variable it takes anywhere from 3
> to 10 minutes depending on the input values.