Bind Peeking By Example
(Doc ID 430208.1)
Last updated on SEPTEMBER 20, 2022
Applies to:
Oracle Database Cloud Schema Service - Version N/A and laterOracle Database - Enterprise Edition - Version 9.2.0.1 and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.
Goal
The purpose of this note is to demonstrate the concept of bind peeking. For more details about bind peeking, refer to:
Oracle® Database Performance Tuning Guide
11g Release 2 (11.2)
Part Number E16638-07
Chapter 11 The Query Optimizer
Section 11.1.3 Bind Variable Peeking
http://docs.oracle.com/cd/E36909_01/server.1111/e16638/optimops.htm#i79423
Bind peeking was introduced in Oracle 9i and 10g.The query optimizer peeks at the values of user-defined bind variables on the first invocation of a cursor. This feature allows the optimizer to determine the selectivity of any WHERE clause condition.
Up to 10g, no further peeking takes place on subsequent invocations of the cursor and the cursor is shared based on the standard cursor-sharing criteria, even if subsequent invocations use different bind values.
From 11g, the adaptive cursor sharing feature enables a single statement that contains bind variables to use different execution plans for different binds.
For more information on Adaptive Cursor Sharing See
<Document 1518681.1> FAQ: Adaptive Cursor Sharing (ACS) Frequently Asked Questions
Oracle® Database Performance Tuning Guide
11g Release 2 (11.2)
Part Number E16638-07
Chapter 11 The Query Optimizer
11.1.3.1 Adaptive Cursor Sharing
http://docs.oracle.com/cd/E11882_01/server.112/e41573/optimops.htm#PFGRF95174
This document demonstrates Bind Peeking as it exists prior to 11g without the option of Adaptive Cursor Sharing.
Solution
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Goal |
Solution |
Setup |
Example |
Conclusion |
References |