RE: RE: oracle can ignore hints

  • From: "Khedr, Waleed" <Waleed.Khedr@xxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 10 Mar 2004 10:01:19 -0500

A hint that will cause incorrect results to be returned if it was followed,
can not be considered a valid hint.
 
Waleed
 
 

-----Original Message-----
From: Jared.Still@xxxxxxxxxxx [mailto:Jared.Still@xxxxxxxxxxx]
Sent: Wednesday, March 10, 2004 12:59 AM
To: oracle-l@xxxxxxxxxxxxx
Subject: Re: RE: oracle can ignore hints



It would be nice to see a reproducible test case of a hint being ignored. 

Here's one you can try: 

drop table t; 

create table t( c1 varchar2(30)); 

create index tidx on t(c1); 

insert into t values(null); 

commit; 

exec dbms_stats.gather_table_stats(user,'T') 

set autotrace on 

select /*+ index(t tidx) */ 
c1 
from t 
where c1 is null 
/ 

set autotrace off 

update t set c1 = 'DATA'; 
commit; 

exec dbms_stats.gather_table_stats(user,'T') 
set autotrace on 

select /*+ index(t tidx) */ 
c1 
from t 
where c1='DATA' 
/ 

select 
c1 
from t 
where c1='DATA' 
/ 

set autotrace off 


You will notice that the hint in the first query is 'ignored'. 

If you do a 10053 trace on the first query you will see that the index TIDX
is not 
even considered for use as an access path.  Does this mean that the index 
hint was ignored? 

The second query uses the index because the hint tells the CBO to do so.
The 
third query is a FTS because that's what the CBO would rather do. 


HTH 

Jared 







        <ryan.gaffuri@xxxxxxx> 
Sent by: oracle-l-bounce@xxxxxxxxxxxxx 


 03/09/2004 10:30 AM 
 Please respond to oracle-l 


        
        To:        oracle-l@xxxxxxxxxxxxx 
        cc:         
        Subject:        Re: RE: oracle can ignore hints



so in your opinion hints cannot be ignored? 
> 
> From: "Cary Millsap" <cary.millsap@xxxxxxxxxx>
> Date: 2004/03/09 Tue AM 11:02:24 EST
> To: <oracle-l@xxxxxxxxxxxxx>
> Subject: RE: oracle can ignore hints
> 
> For what it's worth, after spending time with Jonathan Lewis and Connor
> McDonald in the past two days, I am deeply and thoroughly convinced that
> hints are directives, not suggestions.
> 
> 
> Cary Millsap
> Hotsos Enterprises, Ltd.
> http://www.hotsos.com
> * Nullius in verba *
> 
> Upcoming events:
> - Performance Diagnosis 101: 3/23 Park City, 4/6 Seattle
> - Hotsos Symposium 2004: March 7-10 Dallas
> - Visit www.hotsos.com for schedule details...
> 
> 
> -----Original Message-----
> From: oracle-l-bounce@xxxxxxxxxxxxx
> [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of R Zijlstra
> Sent: Monday, March 08, 2004 7:55 AM
> To: oracle-l@xxxxxxxxxxxxx
> Subject: RE: oracle can ignore hints
> 
> Excellent indeed...
> As far as I now understand, Oracle can use a hint or it can use it not.
> The
> 'hinting behaviour' is not predictable, but it doesn't seem to hinder
> 'normal (?)' execution of sql.
> 
> Might it be possible, that hints are somehow tied in with a marketing
> policy
> when Oracle needed something to talk about??
> 
> Rob Zijlstra
> -----------------------------
> 
> 
> -----Original Message-----
> From: oracle-l-bounce@xxxxxxxxxxxxx
> [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
> On Behalf Of Cary Millsap
> Sent: Monday, March 08, 2004 2:39 PM
> To: oracle-l@xxxxxxxxxxxxx
> Subject: RE: oracle can ignore hints
> 
> Excellent!
> 
> 
> Cary Millsap
> Hotsos Enterprises, Ltd.
> http://www.hotsos.com
> * Nullius in verba *





Other related posts: