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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Bind variable peeking and Dynamic sampling

RE: Bind variable peeking and Dynamic sampling

From: Elliott, Patrick <patrick.elliott_at_medtronic.com>
Date: Tue, 8 May 2007 13:12:34 -0500
Message-ID: <302F06193D7F4D48ABC997408E786BD002146552@MSPM1BMSGM09.ent.core.medtronic.com>

BTW. I can't take credit for the below information. It is from a presentation by Gaja Krishna Vaidyanatha. I would highly recommend him as a source of information. His web site is www.dbperfman.com.

Pat

-----Original Message-----

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Elliott, Patrick Sent: Tuesday, May 08, 2007 1:03 PM
To: Mark.Bobak_at_il.proquest.com; Brandon.Allen_at_OneNeck.com; greg_at_structureddata.org; Oracle-L; fairlie_r_at_yahoo.com Subject: RE: Bind variable peeking and Dynamic sampling

You can control how dynamic sampling occurs with an init.ora parameter called OPTIMIZER_DYNAMIC_SAMPLING. Here are the values:

0 - No dynamic sampling
1 - No dynamic sampling if query has less than 2 tables, table has no indexes, has not been analyzed, a full-scan is deemed expensive
2 - Dynamic sampling on all un-analyzed tables, # of sampled blocks=32 ß Most relevant level
3 - #2 + for tables where selectivity estimation was done
4 - #3 + single table predicates that refer 2 or more columns in the WHERE clause
5 thru 9 - Same as 4, but with sampled blocks=64, 128, 256, 1028, 4096 10 - Same as 4, but all blocks in the table are sampled

Pat

-----Original Message-----

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Bobak, Mark Sent: Tuesday, May 08, 2007 12:45 PM
To: Brandon.Allen_at_OneNeck.com; greg_at_structureddata.org; Oracle-L; fairlie_r_at_yahoo.com Subject: RE: Bind variable peeking and Dynamic sampling

Brandon,

I agree that having a hint to selectively hard parse (or, really, just selectively recompute execution plan) would be quite useful. But I suspect Oracle is hesitant to provide it, for fear that it becomes a "magic bullet", and people begin overusing it, causing an overall degradation in performance. It would be great, but would need to be very selectively applied.

-Mark

PS Hmm....now, where do I go to file an enhancement request?

--

Mark J. Bobak
Senior Oracle Architect
ProQuest/CSA

"There are 10 types of people in the world: Those who understand binary, and those who don't."

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Allen, Brandon Sent: Tuesday, May 08, 2007 12:58 PM
To: greg_at_structureddata.org; Oracle-L; fairlie_r_at_yahoo.com Subject: RE: Bind variable peeking and Dynamic sampling

Not that Wolfgang's suggestion isn't a good one, but just FYI - in my case, I got rid of histograms and am still having the problems of inappropriate plan sharing due to bind variable peeking.

I've filed enhancement request 6030306 to add a hint or some other method of forcing Oracle to always hard-parse and bind-peek for certain queries. If any of you agree this would be a good enhancement, please submit an enhancement request of your own and reference the above ER number and if enough of us ask for it, hopefully they'll add it soon.

Thanks,
Brandon

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Greg Rahn

Wolfgang's suggestion to remove any histograms might be the best bet.

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

--

http://www.freelists.org/webpage/oracle-l



CONFIDENTIALITY AND PRIVACY NOTICE
Information transmitted by this email is proprietary to Medtronic and is intended for use only by the individual or entity to which it is addressed, and may contain information that is private, privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please delete this mail from your records. http://emaildisclaimer.medtronic.com
--

http://www.freelists.org/webpage/oracle-l

CONFIDENTIALITY AND PRIVACY NOTICE
Information transmitted by this email is proprietary to Medtronic and is intended for use only by the individual or entity to which it is addressed, and may contain information that is private, privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please delete this mail from your records. http://emaildisclaimer.medtronic.com
--

http://www.freelists.org/webpage/oracle-l Received on Tue May 08 2007 - 13:12:34 CDT

Original text of this message

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