Re: Date bind variable being peeked, but not used for cardinality estimate
Date: Thu, 24 Sep 2009 13:21:38 -0500
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.
extractvalue(value(d), '/hint') as outline_hints from
xmltype(other_xml) as xmlval
sql_id like nvl('&sql_id',sql_id)
and child_number = &child_no
and other_xml is not null
If it's been turned off, you should see a hint something like this:
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:
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 10.1.2.3, 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.