Ewww! Could be dangerous on low cardinality b-tree columns (that's a whole
other thread!) if an ad-hoc mistakenly filters on the "wrong" (majority)
value.
Thanks for the heads-up! Time to RTFM (or wait until I get sent to 9i
class. :)
Rich
Rich Jesse System/Database Administrator
[EMAIL PROTECTED] Quad/Tech International, Sussex, WI USA
-----Original Message-----
Sent: Monday, March 10, 2003 3:54 PM
To: [EMAIL PROTECTED]
Cc: Jesse, Rich
Importance: High
>From the performance tuning guide:
The CBO peeks at the values of user-defined bind variables on the first
invocation of a cursor. This feature lets the optimizer determine the
selectivity of any WHERE clause condition, as well as if literals have been
used instead of bind
variables. On subsequent invocations of the cursor, no peeking takes
place, and the cursor is shared, based on the standard cursor-sharing
criteria, even if subsequent invocations use different bind values.
CBO only peeks the bind variable once, so that wouldn't help much
for star transforms and histograms.
Jared
"Jesse, Rich" <[EMAIL PROTECTED]>
03/10/2003 01:39 PM
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: RE: Oracle position on hints
I thought that went out the window with 9i because it can snoop at the
bind
variables??
Rich
Rich Jesse System/Database Administrator
[EMAIL PROTECTED] Quad/Tech International, Sussex, WI USA
-----Original Message-----
Sent: Monday, March 10, 2003 12:09 PM
To: Multiple recipients of list ORACLE-L
Well, I wouldn't say you should *always* use bind variables.
Many situations in a database warehouse preclude that.
Potentially long running queries may need to have literals
to help the CBO make the right choice.
Star transforms don't work with bind variables, and histograms
can't be used with bind variables.
Jared
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Jesse, Rich
INET: [EMAIL PROTECTED]
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (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).