Re: Bind Variable - Query slow
Date: Tue, 27 Mar 2012 13:55:58 -0700
Oracle's behaviour seems a bit strange. Contrary to metalink entry method_opt 254 buckets does get decent response though not the best. We have more issues to iron out. But at least we seem to have hold of one issue :-(
On Fri, Mar 23, 2012 at 9:33 AM, Greg Rahn <greg_at_structureddata.org> wrote:
> Does the column referenced by the bind variable have a histogram on it?
> If so, is the value a popular one or not? Have you experimented w/o a
> I would troubleshoot the root cause, but one option is to use a SQL plan
> baseline to give the plan from the literal version to the bind version.
> On Thu, Mar 22, 2012 at 10:53 PM, GovindanK <gkatteri_at_gmail.com> wrote:
>> Linux RAC ,126.96.36.199
>> 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 '&'
>> query runs in 1 second .. but with bind variable it takes anywhere from 3
>> to 10 minutes depending on the input values.
>> With hard code , it does not do MCJ but plan is different for few tables.
>> I don't say the query is written the best way.
> Greg Rahn | blog <http://bit.ly/u9N0i8> | twitter<http://bit.ly/v733dJ> |
> linkedin <http://linkd.in/gregrahn>