Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> RE: bind vars change explain plan

RE: bind vars change explain plan

From: Hately Mike <>
Date: Tue, 23 Jul 2002 02:58:20 -0800
Message-ID: <>


"Beginning with Oracle9i, the optimizer will consider bind variable values when choosing execution plans."

Does anyone know how Oracle manages to do this? The 9i Database Performance Tuning Guide infers that the treatment of bind variables has not changed but maybe we attribute this to "manual lag". Presumably it must perform some kind of parse to rejig the execution plan despite the use of bind variables. Somewhere between hard and soft perhaps. A "fairly solid" parse.
Anyone know the mechanics of this? Has anyone seen this new functionality in practice?

Mike Hately

-----Original Message-----
Sent: 23 July 2002 09:58
To: Multiple recipients of list ORACLE-L

>From the O'Reilly "Oracle SQL Tuning Pocket Reference"

"There is one situation in which bind variables are not such a great choice. If you have column data in a table having a disproportionate number of rows with certain values, and a very small number of rows with other values, you should be using histograms. Bind variables cannot use histogram information."

"Using bind variables will prevent the optimizer from doing this, [using histograms] because the optimizer is unaware of the value that will be in the bind variable at the time it decides on the execution plan"

"Beginning with Oracle9i, the optimizer will consider bind variable values when choosing execution plans."


This email and any attached to it are confidential and intended only for the individual or
entity to which it is addressed. If you are not the intended recipient, please let us know
by telephoning or emailing the sender. You should also delete the email and any attachment
from your systems and should not copy the email or any attachment or disclose their content
to any other person or entity. The views expressed here are not necessarily those of
Churchill Insurance Group plc or its affiliates or subsidiaries. Thank you. Churchill Insurance Group plc. Company Registration Number - 2280426. England.
Registered Office: Churchill Court, Westmoreland Road, Bromley, Kent BR1 1DP.

Please see the official ORACLE-L FAQ:
Author: Hately Mike

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
To REMOVE yourself from this mailing list, send an E-Mail message
to: (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Jul 23 2002 - 05:58:20 CDT

Original text of this message