RE: Different Plans for Literal Vs Bind Variables
Date: Fri, 9 Jan 2009 16:14:41 -0700
The phrase "would not have been" indicates an assumption to me and you know what happens when we assume :-) I would leave nothing to chance and check v$sql for the specific hash_value that appears in your raw 10046 trace file to be 100% positive that the query is not loaded in your library cache before you run it with the desired bind variable value. Then, if you verify that it gets hard parsed with the desired bind value and still doesn't get the same plan as the literal, I think your next step is to run two 10053 traces and diff them. In case you're not familiar with the 10053 trace, here's a good place to start:
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Ian MacGregor
The statements were new so they
would not have been in the library cache, and the values reported for the 10046 level 12 trace matched those in the query with literals
Privileged/Confidential Information may be contained in this message or attachments hereto. Please advise immediately if you or your employer do not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of this company shall be understood as neither given nor endorsed by it.
http://www.freelists.org/webpage/oracle-l Received on Fri Jan 09 2009 - 17:14:41 CST