<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: What Would Cause a NO_INDEX Hint to Not Work as Expected?</title>
	<atom:link href="http://hoopercharles.wordpress.com/2011/07/11/what-would-cause-a-no_index-hint-to-not-work-as-expected/feed/" rel="self" type="application/rss+xml" />
	<link>http://hoopercharles.wordpress.com/2011/07/11/what-would-cause-a-no_index-hint-to-not-work-as-expected/</link>
	<description>Miscellaneous Random Oracle Topics: Stop, Think, ... Understand</description>
	<lastBuildDate>Thu, 23 May 2013 04:02:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Akhil Mahajan</title>
		<link>http://hoopercharles.wordpress.com/2011/07/11/what-would-cause-a-no_index-hint-to-not-work-as-expected/#comment-5273</link>
		<dc:creator><![CDATA[Akhil Mahajan]]></dc:creator>
		<pubDate>Wed, 20 Feb 2013 12:33:20 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5133#comment-5273</guid>
		<description><![CDATA[I was so silly. Just using the table alias in no_index hint helped me. For past 7-8 days, I kept thinking that no_index hint just cannot work.]]></description>
		<content:encoded><![CDATA[<p>I was so silly. Just using the table alias in no_index hint helped me. For past 7-8 days, I kept thinking that no_index hint just cannot work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hanan</title>
		<link>http://hoopercharles.wordpress.com/2011/07/11/what-would-cause-a-no_index-hint-to-not-work-as-expected/#comment-4387</link>
		<dc:creator><![CDATA[Hanan]]></dc:creator>
		<pubDate>Wed, 08 Feb 2012 11:56:52 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5133#comment-4387</guid>
		<description><![CDATA[10x for your quick answer and your good &quot;compile&quot; .]]></description>
		<content:encoded><![CDATA[<p>10x for your quick answer and your good &#8220;compile&#8221; .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2011/07/11/what-would-cause-a-no_index-hint-to-not-work-as-expected/#comment-4385</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Wed, 08 Feb 2012 11:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5133#comment-4385</guid>
		<description><![CDATA[Hanan,

Your NO_INDEX hint appears to be incompletely formed.  Please try the following to see if the execution plan changes:
&lt;pre&gt;
select count(*) from
(select /*+ NO_INDEX(c CDR_IND_03) */
s.main_resource, s.OPERATOR_CODE , s.ORIGINATED_PREPAID_IND
from   lb_5.subscriber s , lb_5.cdr c
where
c.recieve_time between TO_DATE(&#039;01/01/2012&#039;,&#039;DD/MM/YYYY&#039;) and TO_DATE(&#039;09/02/2012&#039;,&#039;DD/MM/YYYY&#039;)
and s.operator_code=&#039;Partner&#039;
and s.ORIGINATED_PREPAID_IND=&#039;0&#039;
and s.main_resource=c.Anumber
and substr(lb_5.get_avl(avl,&#039;DialedDigits&#039;),1,3) = &#039;117&#039;
group by s.main_resource, s.OPERATOR_CODE , s.ORIGINATED_PREPAID_IND)
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Hanan,</p>
<p>Your NO_INDEX hint appears to be incompletely formed.  Please try the following to see if the execution plan changes:</p>
<pre>
select count(*) from
(select /*+ NO_INDEX(c CDR_IND_03) */
s.main_resource, s.OPERATOR_CODE , s.ORIGINATED_PREPAID_IND
from   lb_5.subscriber s , lb_5.cdr c
where
c.recieve_time between TO_DATE('01/01/2012','DD/MM/YYYY') and TO_DATE('09/02/2012','DD/MM/YYYY')
and s.operator_code='Partner'
and s.ORIGINATED_PREPAID_IND='0'
and s.main_resource=c.Anumber
and substr(lb_5.get_avl(avl,'DialedDigits'),1,3) = '117'
group by s.main_resource, s.OPERATOR_CODE , s.ORIGINATED_PREPAID_IND)
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hanan</title>
		<link>http://hoopercharles.wordpress.com/2011/07/11/what-would-cause-a-no_index-hint-to-not-work-as-expected/#comment-4384</link>
		<dc:creator><![CDATA[Hanan]]></dc:creator>
		<pubDate>Wed, 08 Feb 2012 10:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5133#comment-4384</guid>
		<description><![CDATA[Hi,

Following is an example of NO_INDEX is not working in 10g:  Same SQL in 11.2.0.2 w/o any hints doesn&#039;t use the Index and working much mush faster:
&lt;pre&gt;
select count(*) from
(select /*+ NO_INDEX(c CDR_IND_03*/
s.main_resource, s.OPERATOR_CODE , s.ORIGINATED_PREPAID_IND
from   lb_5.subscriber s , lb_5.cdr c
where
c.recieve_time between TO_DATE(&#039;01/01/2012&#039;,&#039;DD/MM/YYYY&#039;) and TO_DATE(&#039;09/02/2012&#039;,&#039;DD/MM/YYYY&#039;)
and s.operator_code=&#039;Partner&#039;
and s.ORIGINATED_PREPAID_IND=&#039;0&#039;
and s.main_resource=c.Anumber
and substr(lb_5.get_avl(avl,&#039;DialedDigits&#039;),1,3) = &#039;117&#039;
group by s.main_resource, s.OPERATOR_CODE , s.ORIGINATED_PREPAID_IND)

PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------------------------------------------
Plan hash value: 1033640149

-----------------------------------------------------------------------------------------------------------------------------
&#124; Id  &#124; Operation                               &#124; Name       &#124; Rows  &#124; Bytes &#124;TempSpc&#124; Cost (%CPU)&#124; Time     &#124; Pstart&#124; Pstop 
-----------------------------------------------------------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT                        &#124;            &#124;     1 &#124;       &#124;       &#124;   923   (1)&#124; 00:00:12 &#124;       &#124;       
&#124;   1 &#124;  SORT AGGREGATE                         &#124;            &#124;     1 &#124;       &#124;       &#124;            &#124;          &#124;       &#124;       
&#124;   2 &#124;   VIEW                                  &#124;            &#124;  3377 &#124;       &#124;       &#124;   923   (1)&#124; 00:00:12 &#124;       &#124;       
&#124;   3 &#124;    HASH GROUP BY                        &#124;            &#124;  3377 &#124;  2186K&#124;  4520K&#124;   923   (1)&#124; 00:00:12 &#124;       &#124;       
&#124;*  4 &#124;     HASH JOIN                           &#124;            &#124;  3377 &#124;  2186K&#124;       &#124;   447   (2)&#124; 00:00:06 &#124;       &#124;       
&#124;*  5 &#124;      TABLE ACCESS FULL                  &#124; SUBSCRIBER &#124; 27819 &#124;   516K&#124;       &#124;   446   (1)&#124; 00:00:06 &#124;       &#124;       
&#124;   6 &#124;      PARTITION RANGE ITERATOR           &#124;            &#124; 15575 &#124;  9795K&#124;       &#124;     0   (0)&#124; 00:00:01 &#124;     9 &#124;    18 
&#124;   7 &#124;       PARTITION LIST ALL                &#124;            &#124; 15575 &#124;  9795K&#124;       &#124;     0   (0)&#124; 00:00:01 &#124;     1 &#124;    17 
&#124;*  8 &#124;        TABLE ACCESS BY LOCAL INDEX ROWID&#124; CDR        &#124; 15575 &#124;  9795K&#124;       &#124;     0   (0)&#124; 00:00:01 &#124;   137 &#124;   306 
&#124;*  9 &#124;         INDEX SKIP SCAN                 &#124; CDR_IND_03 &#124; 52700 &#124;       &#124;       &#124;     0   (0)&#124; 00:00:01 &#124;   137 &#124;   306 
-----------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;S&quot;.&quot;MAIN_RESOURCE&quot;=&quot;C&quot;.&quot;ANUMBER&quot;)
   5 - filter(&quot;S&quot;.&quot;MAIN_RESOURCE&quot; IS NOT NULL AND &quot;S&quot;.&quot;ORIGINATED_PREPAID_IND&quot;=0 AND &quot;S&quot;.&quot;OPERATOR_CODE&quot;=&#039;Partner&#039;)

PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------------------------------------------
   8 - filter(SUBSTR(&quot;LB_5&quot;.&quot;GET_AVL&quot;(&quot;AVL&quot;,&#039;DialedDigits&#039;),1,3)=&#039;117&#039;)
   9 - access(&quot;C&quot;.&quot;RECIEVE_TIME&quot;&gt;=TO_DATE(&#039; 2012-01-01 00:00:00&#039;, &#039;syyyy-mm-dd hh24:mi:ss&#039;) AND
              &quot;C&quot;.&quot;RECIEVE_TIME&quot;&lt;=TO_DATE(&#039; 2012-02-09 00:00:00&#039;, &#039;syyyy-mm-dd hh24:mi:ss&#039;))
       filter(&quot;C&quot;.&quot;RECIEVE_TIME&quot;&lt;=TO_DATE(&#039; 2012-02-09 00:00:00&#039;, &#039;syyyy-mm-dd hh24:mi:ss&#039;))

26 rows selected.
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Following is an example of NO_INDEX is not working in 10g:  Same SQL in 11.2.0.2 w/o any hints doesn&#8217;t use the Index and working much mush faster:</p>
<pre>
select count(*) from
(select /*+ NO_INDEX(c CDR_IND_03*/
s.main_resource, s.OPERATOR_CODE , s.ORIGINATED_PREPAID_IND
from   lb_5.subscriber s , lb_5.cdr c
where
c.recieve_time between TO_DATE('01/01/2012','DD/MM/YYYY') and TO_DATE('09/02/2012','DD/MM/YYYY')
and s.operator_code='Partner'
and s.ORIGINATED_PREPAID_IND='0'
and s.main_resource=c.Anumber
and substr(lb_5.get_avl(avl,'DialedDigits'),1,3) = '117'
group by s.main_resource, s.OPERATOR_CODE , s.ORIGINATED_PREPAID_IND)

PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------------------------------------------
Plan hash value: 1033640149

-----------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                               | Name       | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop 
-----------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                        |            |     1 |       |       |   923   (1)| 00:00:12 |       |       
|   1 |  SORT AGGREGATE                         |            |     1 |       |       |            |          |       |       
|   2 |   VIEW                                  |            |  3377 |       |       |   923   (1)| 00:00:12 |       |       
|   3 |    HASH GROUP BY                        |            |  3377 |  2186K|  4520K|   923   (1)| 00:00:12 |       |       
|*  4 |     HASH JOIN                           |            |  3377 |  2186K|       |   447   (2)| 00:00:06 |       |       
|*  5 |      TABLE ACCESS FULL                  | SUBSCRIBER | 27819 |   516K|       |   446   (1)| 00:00:06 |       |       
|   6 |      PARTITION RANGE ITERATOR           |            | 15575 |  9795K|       |     0   (0)| 00:00:01 |     9 |    18 
|   7 |       PARTITION LIST ALL                |            | 15575 |  9795K|       |     0   (0)| 00:00:01 |     1 |    17 
|*  8 |        TABLE ACCESS BY LOCAL INDEX ROWID| CDR        | 15575 |  9795K|       |     0   (0)| 00:00:01 |   137 |   306 
|*  9 |         INDEX SKIP SCAN                 | CDR_IND_03 | 52700 |       |       |     0   (0)| 00:00:01 |   137 |   306 
-----------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access("S"."MAIN_RESOURCE"="C"."ANUMBER")
   5 - filter("S"."MAIN_RESOURCE" IS NOT NULL AND "S"."ORIGINATED_PREPAID_IND"=0 AND "S"."OPERATOR_CODE"='Partner')

PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------------------------------------------
   8 - filter(SUBSTR("LB_5"."GET_AVL"("AVL",'DialedDigits'),1,3)='117')
   9 - access("C"."RECIEVE_TIME"&gt;=TO_DATE(' 2012-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
              "C"."RECIEVE_TIME"&lt;=TO_DATE(&#039; 2012-02-09 00:00:00&#039;, &#039;syyyy-mm-dd hh24:mi:ss&#039;))
       filter(&quot;C&quot;.&quot;RECIEVE_TIME&quot;&lt;=TO_DATE(&#039; 2012-02-09 00:00:00&#039;, &#039;syyyy-mm-dd hh24:mi:ss&#039;))

26 rows selected.
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2011/07/11/what-would-cause-a-no_index-hint-to-not-work-as-expected/#comment-3638</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Mon, 11 Jul 2011 15:04:47 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5133#comment-3638</guid>
		<description><![CDATA[Gokhan,

That MOS (Metalink) article is an interesting find - thank you for locating it.

I see that the article was last modified November 11, 2010.  The article lists as a reference a bug that applies to Oracle Database 7.1.6.2.  I think that the MOS article is in need of quite a bit of editing.  The take aways from that article:
* Can a unique index not be a b*tree index?
* I should set DB_FILE_MULTIBLOCK_READ_COUNT to a value greater than 16 so that my NO_INDEX hint works?

Here is a quick test on 11.2.0.2 to demonstrate that the MOS article does not apply to 11.2.0.2 (that is one of the few release versions you did not test).  First, a basic query using the sample table created in the article:
&lt;pre&gt;
SET LINESIZE 140
SET PAGESIZE 1000
 
SELECT /*+ GATHER_PLAN_STATISTICS */
  C1,
  C2,
  C3,
  SUBSTR(C4,1,10) C4
FROM
  T3
WHERE
  C1&lt;=20;
 
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,&#039;ALLSTATS LAST&#039;));
 
SQL_ID  0s5xrvx04309f, child number 0
-------------------------------------
SELECT /*+ GATHER_PLAN_STATISTICS */   C1,   C2,   C3,
SUBSTR(C4,1,10) C4 FROM   T3 WHERE   C1&lt;=20
 
Plan hash value: 1371903174
 
---------------------------------------------------------------------------------------------------
&#124; Id  &#124; Operation                   &#124; Name      &#124; Starts &#124; E-Rows &#124; A-Rows &#124;   A-Time   &#124; Buffers &#124;
---------------------------------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT            &#124;           &#124;      1 &#124;        &#124;     20 &#124;00:00:00.01 &#124;       8 &#124;
&#124;   1 &#124;  TABLE ACCESS BY INDEX ROWID&#124; T3        &#124;      1 &#124;     20 &#124;     20 &#124;00:00:00.01 &#124;       8 &#124;
&#124;*  2 &#124;   INDEX RANGE SCAN          &#124; IND_T3_C1 &#124;      1 &#124;     20 &#124;     20 &#124;00:00:00.01 &#124;       5 &#124;
---------------------------------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access(&quot;C1&quot;&lt;=20)
&lt;/pre&gt;
The non-unique index was selected by default.

Now drop that non-unique index, create a unique index on the same column, and try the SQL statement again:
&lt;pre&gt;
DROP INDEX IND_T3_C1;
CREATE UNIQUE INDEX IND_T3_C1_UNIQUE ON T3(C1);
 
EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=&gt;USER,TABNAME=&gt;&#039;T3&#039;,CASCADE=&gt;TRUE,ESTIMATE_PERCENT=&gt;100)
 
SELECT /*+ GATHER_PLAN_STATISTICS */
  C1,
  C2,
  C3,
  SUBSTR(C4,1,10) C4
FROM
  T3
WHERE
  C1&lt;=20;
 
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,&#039;ALLSTATS LAST&#039;));
 
SQL_ID  0s5xrvx04309f, child number 0
-------------------------------------
SELECT /*+ GATHER_PLAN_STATISTICS */   C1,   C2,   C3,
SUBSTR(C4,1,10) C4 FROM   T3 WHERE   C1&lt;=20
 
Plan hash value: 66750336
 
----------------------------------------------------------------------------------------------------------
&#124; Id  &#124; Operation                   &#124; Name             &#124; Starts &#124; E-Rows &#124; A-Rows &#124;   A-Time   &#124; Buffers &#124;
----------------------------------------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT            &#124;                  &#124;      1 &#124;        &#124;     20 &#124;00:00:00.01 &#124;       8 &#124;
&#124;   1 &#124;  TABLE ACCESS BY INDEX ROWID&#124; T3               &#124;      1 &#124;     20 &#124;     20 &#124;00:00:00.01 &#124;       8 &#124;
&#124;*  2 &#124;   INDEX RANGE SCAN          &#124; IND_T3_C1_UNIQUE &#124;      1 &#124;     20 &#124;     20 &#124;00:00:00.01 &#124;       5 &#124;
----------------------------------------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access(&quot;C1&quot;&lt;=20)
&lt;/pre&gt;
The optimizer selected to use the unique index, as expected.

Trying again with the NO_INDEX hint:
&lt;pre&gt;
SELECT /*+ NO_INDEX(T3 IND_T3_C1_UNIQUE) GATHER_PLAN_STATISTICS */
  C1,
  C2,
  C3,
  SUBSTR(C4,1,10) C4
FROM
  T3
WHERE
  C1&lt;=20;
 
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,&#039;ALLSTATS LAST&#039;));
 
SQL_ID  gvsjzs6x62f1d, child number 0
-------------------------------------
SELECT /*+ NO_INDEX(T3 IND_T3_C1_UNIQUE) GATHER_PLAN_STATISTICS */
C1,   C2,   C3,   SUBSTR(C4,1,10) C4 FROM   T3 WHERE   C1&lt;=20
 
Plan hash value: 4161002650
 
------------------------------------------------------------------------------------
&#124; Id  &#124; Operation         &#124; Name &#124; Starts &#124; E-Rows &#124; A-Rows &#124;   A-Time   &#124; Buffers &#124;
------------------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT  &#124;      &#124;      1 &#124;        &#124;     20 &#124;00:00:00.01 &#124;   45583 &#124;
&#124;*  1 &#124;  TABLE ACCESS FULL&#124; T3   &#124;      1 &#124;     20 &#124;     20 &#124;00:00:00.01 &#124;   45583 &#124;
------------------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter(&quot;C1&quot;&lt;=20)
&lt;/pre&gt;
The NO_INDEX hint worked without issue - a full table scan was performed.

---

Another interesting MOS article is this one Doc ID 1051265.1, Bug 5882821 - &quot;Wrong Results from a RANGE-LIST PARTITIONED TABLE&quot;.  Here the NO_INDEX hint was used to produce the correct query results, while the unhinted version provided incorrect results.]]></description>
		<content:encoded><![CDATA[<p>Gokhan,</p>
<p>That MOS (Metalink) article is an interesting find &#8211; thank you for locating it.</p>
<p>I see that the article was last modified November 11, 2010.  The article lists as a reference a bug that applies to Oracle Database 7.1.6.2.  I think that the MOS article is in need of quite a bit of editing.  The take aways from that article:<br />
* Can a unique index not be a b*tree index?<br />
* I should set DB_FILE_MULTIBLOCK_READ_COUNT to a value greater than 16 so that my NO_INDEX hint works?</p>
<p>Here is a quick test on 11.2.0.2 to demonstrate that the MOS article does not apply to 11.2.0.2 (that is one of the few release versions you did not test).  First, a basic query using the sample table created in the article:</p>
<pre>
SET LINESIZE 140
SET PAGESIZE 1000
 
SELECT /*+ GATHER_PLAN_STATISTICS */
  C1,
  C2,
  C3,
  SUBSTR(C4,1,10) C4
FROM
  T3
WHERE
  C1&lt;=20;
 
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST'));
 
SQL_ID  0s5xrvx04309f, child number 0
-------------------------------------
SELECT /*+ GATHER_PLAN_STATISTICS */   C1,   C2,   C3,
SUBSTR(C4,1,10) C4 FROM   T3 WHERE   C1&lt;=20
 
Plan hash value: 1371903174
 
---------------------------------------------------------------------------------------------------
| Id  | Operation                   | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
---------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |           |      1 |        |     20 |00:00:00.01 |       8 |
|   1 |  TABLE ACCESS BY INDEX ROWID| T3        |      1 |     20 |     20 |00:00:00.01 |       8 |
|*  2 |   INDEX RANGE SCAN          | IND_T3_C1 |      1 |     20 |     20 |00:00:00.01 |       5 |
---------------------------------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access("C1"&lt;=20)
</pre>
<p>The non-unique index was selected by default.</p>
<p>Now drop that non-unique index, create a unique index on the same column, and try the SQL statement again:</p>
<pre>
DROP INDEX IND_T3_C1;
CREATE UNIQUE INDEX IND_T3_C1_UNIQUE ON T3(C1);
 
EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=&gt;USER,TABNAME=&gt;'T3',CASCADE=&gt;TRUE,ESTIMATE_PERCENT=&gt;100)
 
SELECT /*+ GATHER_PLAN_STATISTICS */
  C1,
  C2,
  C3,
  SUBSTR(C4,1,10) C4
FROM
  T3
WHERE
  C1&lt;=20;
 
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST'));
 
SQL_ID  0s5xrvx04309f, child number 0
-------------------------------------
SELECT /*+ GATHER_PLAN_STATISTICS */   C1,   C2,   C3,
SUBSTR(C4,1,10) C4 FROM   T3 WHERE   C1&lt;=20
 
Plan hash value: 66750336
 
----------------------------------------------------------------------------------------------------------
| Id  | Operation                   | Name             | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
----------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |                  |      1 |        |     20 |00:00:00.01 |       8 |
|   1 |  TABLE ACCESS BY INDEX ROWID| T3               |      1 |     20 |     20 |00:00:00.01 |       8 |
|*  2 |   INDEX RANGE SCAN          | IND_T3_C1_UNIQUE |      1 |     20 |     20 |00:00:00.01 |       5 |
----------------------------------------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access("C1"&lt;=20)
</pre>
<p>The optimizer selected to use the unique index, as expected.</p>
<p>Trying again with the NO_INDEX hint:</p>
<pre>
SELECT /*+ NO_INDEX(T3 IND_T3_C1_UNIQUE) GATHER_PLAN_STATISTICS */
  C1,
  C2,
  C3,
  SUBSTR(C4,1,10) C4
FROM
  T3
WHERE
  C1&lt;=20;
 
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST'));
 
SQL_ID  gvsjzs6x62f1d, child number 0
-------------------------------------
SELECT /*+ NO_INDEX(T3 IND_T3_C1_UNIQUE) GATHER_PLAN_STATISTICS */
C1,   C2,   C3,   SUBSTR(C4,1,10) C4 FROM   T3 WHERE   C1&lt;=20
 
Plan hash value: 4161002650
 
------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |     20 |00:00:00.01 |   45583 |
|*  1 |  TABLE ACCESS FULL| T3   |      1 |     20 |     20 |00:00:00.01 |   45583 |
------------------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter("C1"&lt;=20)
</pre>
<p>The NO_INDEX hint worked without issue &#8211; a full table scan was performed.</p>
<p>&#8212;</p>
<p>Another interesting MOS article is this one Doc ID 1051265.1, Bug 5882821 &#8211; &#8220;Wrong Results from a RANGE-LIST PARTITIONED TABLE&#8221;.  Here the NO_INDEX hint was used to produce the correct query results, while the unhinted version provided incorrect results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gokhan Atil</title>
		<link>http://hoopercharles.wordpress.com/2011/07/11/what-would-cause-a-no_index-hint-to-not-work-as-expected/#comment-3637</link>
		<dc:creator><![CDATA[Gokhan Atil]]></dc:creator>
		<pubDate>Mon, 11 Jul 2011 13:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5133#comment-3637</guid>
		<description><![CDATA[There&#039;s a MOS document about nonworking NO_INDEX hint: 

Ineffective SQL Hints NO_INDEX [ID 399942.1]

It says &quot;The NO_INDEX hint does not applying to UNIQUE indexes. The NO_INDEX hint applies to function-based, B*-tree, bitmap, cluster, or domain indexes.&quot;

I have tested it on 9.2.0.8, 10.2.0.3 and 11.2.0.1 and I see that &quot;no_index hint&quot; WORKS as intended even on unique indexes.]]></description>
		<content:encoded><![CDATA[<p>There&#8217;s a MOS document about nonworking NO_INDEX hint: </p>
<p>Ineffective SQL Hints NO_INDEX [ID 399942.1]</p>
<p>It says &#8220;The NO_INDEX hint does not applying to UNIQUE indexes. The NO_INDEX hint applies to function-based, B*-tree, bitmap, cluster, or domain indexes.&#8221;</p>
<p>I have tested it on 9.2.0.8, 10.2.0.3 and 11.2.0.1 and I see that &#8220;no_index hint&#8221; WORKS as intended even on unique indexes.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
