<?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"
	>
<channel>
	<title>Comments on: Using index for IS NULL</title>
	<atom:link href="http://www.oracloid.com/2006/05/using-index-for-is-null/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oracloid.com/2006/05/using-index-for-is-null/</link>
	<description>The Alex Gorbachev Oracle Blog</description>
	<pubDate>Sun, 12 Oct 2008 19:12:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Oracloid</title>
		<link>http://www.oracloid.com/2006/05/using-index-for-is-null/#comment-123</link>
		<dc:creator>Oracloid</dc:creator>
		<pubDate>Fri, 30 Jun 2006 19:05:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.oracloid.com/?p=7#comment-123</guid>
		<description>I guess this is correct from CBO point of view.
Probably, there are too few rows to use the index so optimizer estimates the cost to be lower to go for FTS. Try running these queries with autotrace and that run them with hint /*+ index(t) */. Than compare the cost of using index vs. FTS.</description>
		<content:encoded><![CDATA[<p>I guess this is correct from CBO point of view.<br />
Probably, there are too few rows to use the index so optimizer estimates the cost to be lower to go for FTS. Try running these queries with autotrace and that run them with hint /*+ index(t) */. Than compare the cost of using index vs. FTS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaleem Ullah</title>
		<link>http://www.oracloid.com/2006/05/using-index-for-is-null/#comment-120</link>
		<dc:creator>Kaleem Ullah</dc:creator>
		<pubDate>Fri, 30 Jun 2006 15:47:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.oracloid.com/?p=7#comment-120</guid>
		<description>Hi,
I tried this code but its not working, Please help, thanks in advance


CREATE TABLE t (pcol NUMBER , ncol VARCHAR2(10) NULL , c CHAR(1) DEFAULT '1' NOT NULL  );

INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( 1       , 'name1' , 1 );
INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( NULL    , 'name2' , 2 );
INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( 3       , NULL    , 3 );
INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( NULL    , NULL    , 4 );
INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( 4       , NULL    , 4 );
INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( 5       , 'name3' , 2 );

CREATE INDEX t_ind  ON t (ncol,c);


 BEGIN
    DBMS_STATS.gather_table_stats ( USER , 'T');
  END;

--This query is not usng index 
Select  * from t where ncol = 2

--This query is not usng index 
Select  * from t where ncol is null</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I tried this code but its not working, Please help, thanks in advance</p>
<p>CREATE TABLE t (pcol NUMBER , ncol VARCHAR2(10) NULL , c CHAR(1) DEFAULT &#8216;1&#8242; NOT NULL  );</p>
<p>INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( 1       , &#8216;name1&#8242; , 1 );<br />
INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( NULL    , &#8216;name2&#8242; , 2 );<br />
INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( 3       , NULL    , 3 );<br />
INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( NULL    , NULL    , 4 );<br />
INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( 4       , NULL    , 4 );<br />
INSERT INTO t ( pcol , ncol ,  c  ) VALUES ( 5       , &#8216;name3&#8242; , 2 );</p>
<p>CREATE INDEX t_ind  ON t (ncol,c);</p>
<p> BEGIN<br />
    DBMS_STATS.gather_table_stats ( USER , &#8216;T&#8217;);<br />
  END;</p>
<p>&#8211;This query is not usng index<br />
Select  * from t where ncol = 2</p>
<p>&#8211;This query is not usng index<br />
Select  * from t where ncol is null</p>
]]></content:encoded>
	</item>
</channel>
</rss>
