My Oracle Support Banner

Bind Peeking By Example (Doc ID 430208.1)

Last updated on OCTOBER 24, 2019

Applies to:

Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database - Enterprise Edition - Version 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.
Checked for relevance on 26-mar-2013


NOTE: In the images and/or the document content below, the user information and data used represents fictitious data from the Oracle sample schema(s) or Public Documentation delivered with an Oracle database product. Any similarity to actual persons, living or dead, is purely coincidental and not intended in any manner.

The purpose of this note is to demonstrate the concept of bind peeking. For more details about bind peeking, refer to:

<Document 387394.1> Query using Bind Variables is suddenly slow.

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

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 740052.1> Adaptive Cursor Sharing: Overview
<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 Adaptive Cursor Sharing


This document demonstrates Bind Peeking as it exists prior to 11g without the option of Adaptive Cursor Sharing.


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

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.