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: Oracle position on hints (talking about bind variables)

RE: Oracle position on hints (talking about bind variables)

From: Mark Richard <mrichard_at_transurban.com.au>
Date: Mon, 10 Mar 2003 19:18:36 -0800
Message-ID: <F001.00565831.20030310191836@fatcity.com>


My first consideration with regards to bind variables is to consider the cost of parsing the query. After all the benefit of bind variables (or at least a major one) is to reduce the number of parses required. If the query is going to be executed so rarely that the parse cost (a fraction of a second typically) isn't significant then there appears to be little benefit.

I think bind variables are most useful in OTLP where the same query gets fired again and again (especially when you have hundreds of client connections). At the other extreme (a batch query executed once per day) they aren't required. Therefore my approach tends to be "is the query going to be executed very frequently - if so then look at using bind variables on the values that will change".

Regards,

     Mark.

                                                                                                                   
                    Jared.Still_at_ra                                                                                 
                    disys.com            To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>       
                    Sent by:             cc:                                                                       
                    root_at_fatcity.c       Subject:     RE: Oracle position on hints                                 
                    om                                                                                             
                                                                                                                   
                                                                                                                   
                    11/03/2003                                                                                     
                    05:09                                                                                          
                    Please respond                                                                                 
                    to 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

"Nicoll, Iain" <IAIN.D.NICOLL_at_saic.com>
Sent by: root_at_fatcity.com
 03/08/2003 06:23 AM
 Please respond to ORACLE-L

        To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
        cc:
        Subject:        RE: Oracle position on hints


Given the attitude of most dba's that you should always use bind variables where possible I can't see how you'd cope with skewed data without them. Most developers should know a databases's data better than the optimiser and
certainly when building queries it's always worthwhile seeing where data is
being most effectively filtered.

There are lots of mature systems out there where the data characteristics are unlikely to change much and for most in-house developers you're never going to have to think about portability but always about performance.

Iain Nicoll
-----Original Message-----
Sent: 07 March 2003 16:04
To: Multiple recipients of list ORACLE-L

Hi,

Does Oracle have an official position on hints ? Will they go away as the optimiser is becoming bettre or they are there to stay ?

TIA Stephane Paquette

Administrateur de bases de donnees

Database Administrator

Standard Life

www.standardlife.ca

Tél. (514) 925-7187

stephane.paquette_at_standardlife.ca <mailto:stephane.paquette_at_standardlife.ca
>

--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Nicoll, Iain
  INET: IAIN.D.NICOLL_at_saic.com

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: ListGuru_at_fatcity.com (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).




--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author:
  INET: Jared.Still_at_radisys.com

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: ListGuru_at_fatcity.com (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).




<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   Privileged/Confidential information may be contained in this message.
          If you are not the addressee indicated in this message
       (or responsible for delivery of the message to such person),
            you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender
           by reply e-mail or by telephone on (61 3) 9612-6999.
   Please advise immediately if you or your employer does not consent to
                Internet e-mail for messages of this kind.
        Opinions, conclusions and other information in this message
              that do not relate to the official business of
                         Transurban City Link Ltd
         shall be understood as neither given nor endorsed by it.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Mark Richard
  INET: mrichard_at_transurban.com.au

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: ListGuru_at_fatcity.com (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 Mon Mar 10 2003 - 21:18:36 CST

Original text of this message

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