Re: Date bind variable being peeked, but not used for cardinality estimate

From: Kerry Osborne <>
Date: Thu, 24 Sep 2009 13:21:38 -0500
Message-Id: <>


   Another thought just crossed my mind. Peeked bind variables are in the other_xml column of v$sql_plan along with the hints that the optimizer thinks it needs to reproduce the plan. And it's possible to turn off BVP with an alter session, so it's possible your app does that somewhere prior to executing your query. If that has happened you should see a hint to that affect in the other_xml column.

Try this:

extractvalue(value(d), '/hint') as outline_hints from
passing (
xmltype(other_xml) as xmlval
sql_id like nvl('&sql_id',sql_id)
and child_number = &child_no
and other_xml is not null
) d;

If it's been turned off, you should see a hint something like this:

OPT_PARAM('_optim_peek_user_binds' 'false')

You can also have a look at the peeked bind variables themselves. I have a script that has that embedded in it (called build_bind_vars.sql) but it's pretty long and ugly, so I'll just point you to a blog entry on it which is at:

Kerry Osborne

On Sep 24, 2009, at 11:50 AM, Allen, Brandon wrote:

> Hi Christian,
> It was news to me that the variables in v$sql_bind_capture aren't
> necessarily the ones used for peeking - I had misunderstood that
> until now that you and a few others have enlightened me.
> Thanks for the pointer to the Metalink note - I have read that, but
> I'm not sure yet if that's my problem or not. This is an Oracle
> Forms app running on Oracle Application Server, so it is a
> Java application on the client side but I was under the impression
> that the Forms server process (frmweb) running on the app server
> connected to the database through a regular OCI/Oracle Net
> connection (not sure how to confirm that though). Also, the note
> says that JDBC drivers 10g+ do not have this problem and I'd think
> that if Oracle forms is actually using jdbc, it would at least be 10g
> + since it's 10g app server running on a 10g database.
> I've got an SR open for this now so I'll reply back to the list when
> we figure it out.
> Thanks!
> Brandon

Received on Thu Sep 24 2009 - 13:21:38 CDT

Original text of this message