Re: In what circumstances might optimizer not choose the lowest cost?

From: Sayan Sergeevich Malakshinov <>
Date: Wed, 21 Jan 2015 15:14:04 +0300
Message-ID: <>


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.

Received on Wed Jan 21 2015 - 13:14:04 CET

Original text of this message