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: Index hints?

Re: Index hints?

From: zhu chao <chaospku_at_163.net>
Date: Thu, 29 Aug 2002 23:33:26 -0800
Message-ID: <F001.004C3B67.20020829233326@fatcity.com>


Chuan Zhang,                 

    hei£¬you statement choose all rows from the table,Of course oracle will use full table scan!

	There is no where clause in your SQL.If you add:
	select a,b,c from test where a=some_value, then of course it will use the index.


Regards
zhu chao
Eachnet DBA
86-21-32174588-667
chao_ping_at_vip.163.com

>Hi, All,
>
> On a million row table, test, there is primary key on column a.
>
>when I run select /*+ index (test,indx_a) */ a, b, c, from test, according to Oracle, I should get the following explain plan.
>TABLE ACCESS
>BY INDEX ROWID test 1
>INDEX
>UNIQUE SCAN PK_test 1
>
>But I acctucally got :
> TABLE ACCESS
>FULL test 1
>
>The database optimizer mode is choose, and I gathered the statistics on table and index using dbms_utitlity and analyze.
>In the session level, I also set optimizer_mode=first_rows to push optimizer to choose the index.
>According to Oracle Doc "use hints to force the optimizer to use the optimal execution plan.", to my understanding, the explain plan under such a situation, should be the first one.
>
>Does Oracle follow the hint? or to waht extents, it follows?
>
>Appreciated if someone guides me to the right direction.
>
>Chuan,

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡zhu chao
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡chaospku_at_163.net
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2002-08-30



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: zhu chao
  INET: chaospku_at_163.net

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: 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 Fri Aug 30 2002 - 02:33:26 CDT

Original text of this message

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