Re: In what circumstances might optimizer not choose the lowest cost?
Date: Wed, 21 Jan 2015 15:14:04 +0300
Message-ID: <OFF291DF6A.8273EED1-ON43257DD4.0042D39E-43257DD4.00433324_at_psbank.ru>
Kim,
maybe hint "opt_param('_optim_peek_user_binds' 'false')" also can help to avoid problem?
> I tested the fix for this with alter session set events '38068 trace
> name context forever, level 100' - and it worked ! Thanks Mauro.
> (Now I "just" need to decide whether this is OK to set systemwide or not
;-)
>
> So the real root cause is that the optimization in my case seems to
> be before bind variables are set, so this optimizer rule of not
> trusting range scan guesses for unpeeked binds is used.
> Good fix would have been to fix it so the binds were set before
> optimization, but that is not possible, alas :-(
> So my best workaround (for fixing more than just this single query)
> seems to be setting event 38068 to tell the optimizer, that it is OK
> to trust range scan guesses for unpeeked binds.
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Jan 21 2015 - 13:14:04 CET