Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Bad exectution plans due to bind variable peeking

Bad exectution plans due to bind variable peeking

From: Allen, Brandon <Brandon.Allen_at_OneNeck.com>
Date: Fri, 23 Jun 2006 11:15:20 -0700
Message-ID: <04DDF147ED3A0D42B48A48A18D574C45059E1932@NT15.oneneck.corp>


Hello,  

I'm supporting an ERP app (SSA BaanIV) that uses bind variables extensively, which is a good thing for the most part, but occasionally I'm having queries that are suffering from plan instability due to bind variable peeking. A user runs a query with a certain set of bind variable values and Oracle chooses the optimal execution plan for those bind variables - then someone runs the exact same query with wildly different bind variables, but gets stuck with the same execution plan that was optimized for the first execution's bind variables. There are 3 possible solutions/workarounds that I'm aware of:  

  1. Don't use bind variables for these queries - unfortunately I can't do this - it's a canned application. We do have access to modify queries, but can't stop it from using bind variables.
  2. Set _optim_peek_user_binds=false - I don't really want to do this due to the fact that it would most likely do more damage than good since these problems are the rare exception - 99%+ queries are running very well.
  3. Use stored outlines to force a more consistent plan that works decently, although probably not optimally, for both sets of bind variables - this is what I've done up to now.

I'm just curious if anyone else has any ideas other than the 3 above?  

Thanks,
Brandon

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 Jun 23 2006 - 13:15:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US