<?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: Frequency Histograms</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Fri, 24 May 2013 13:27:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/#comment-52079</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 13 Dec 2012 15:01:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1049#comment-52079</guid>
		<description><![CDATA[Sagi,

First you need to work out what you did to get these results - then you can explain how I could reproduce the example.
As it is you haven&#039;t told me how you collected the statistics, or what the table looks like, or how it&#039;s indexed, or what query you ran. Moreover, you haven&#039;t given me any assurance that the pieces of the trace file are equivalent, so you may have omitted lines from the first sample that you&#039;ve shown in the second.

As far as &quot;strange&quot; is concerned - I think it&#039;s possible that you collected stats the first time in a way that got 100% sample and no histogram, and in the second case generated a histogram off a small sample - although I would have expected 5e-7 for the second density.  However, I don&#039;t see the &quot;NewDensity&quot; figures, so I&#039;m not sure you haven&#039;t been running with optimizer_features_enable set to a lower value.]]></description>
		<content:encoded><![CDATA[<p>Sagi,</p>
<p>First you need to work out what you did to get these results &#8211; then you can explain how I could reproduce the example.<br />
As it is you haven&#8217;t told me how you collected the statistics, or what the table looks like, or how it&#8217;s indexed, or what query you ran. Moreover, you haven&#8217;t given me any assurance that the pieces of the trace file are equivalent, so you may have omitted lines from the first sample that you&#8217;ve shown in the second.</p>
<p>As far as &#8220;strange&#8221; is concerned &#8211; I think it&#8217;s possible that you collected stats the first time in a way that got 100% sample and no histogram, and in the second case generated a histogram off a small sample &#8211; although I would have expected 5e-7 for the second density.  However, I don&#8217;t see the &#8220;NewDensity&#8221; figures, so I&#8217;m not sure you haven&#8217;t been running with optimizer_features_enable set to a lower value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sagi Zvi</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/#comment-51015</link>
		<dc:creator><![CDATA[Sagi Zvi]]></dc:creator>
		<pubDate>Sat, 27 Oct 2012 17:28:19 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1049#comment-51015</guid>
		<description><![CDATA[Hi Jonathan.  

There is something strange with density with 11.2.0.2 ..

Table stats:
    #Rows: 1000000  #Blks:  47414  AvgRowLen:  330.00  ChainCnt:  0.00

I have a column with only one distinct value. 
    AvgLen: 3 NDV: 1 Nulls: 0 Density: 1.000000

Now, after i&#039;ve updated 1000 rows to null, the density dropped down .
    AvgLen: 3 NDV: 1 Nulls: 1000 Density: 0.000001
    Histogram: Freq  #Bkts: 1  UncompBkts: 5452  EndPtVals: 1


any thoughts about this?]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan.  </p>
<p>There is something strange with density with 11.2.0.2 ..</p>
<p>Table stats:<br />
    #Rows: 1000000  #Blks:  47414  AvgRowLen:  330.00  ChainCnt:  0.00</p>
<p>I have a column with only one distinct value.<br />
    AvgLen: 3 NDV: 1 Nulls: 0 Density: 1.000000</p>
<p>Now, after i&#8217;ve updated 1000 rows to null, the density dropped down .<br />
    AvgLen: 3 NDV: 1 Nulls: 1000 Density: 0.000001<br />
    Histogram: Freq  #Bkts: 1  UncompBkts: 5452  EndPtVals: 1</p>
<p>any thoughts about this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Histograms for strongly skewed columns &#171; Oracle Diagnostician</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/#comment-46576</link>
		<dc:creator><![CDATA[Histograms for strongly skewed columns &#171; Oracle Diagnostician]]></dc:creator>
		<pubDate>Wed, 23 May 2012 16:35:42 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1049#comment-46576</guid>
		<description><![CDATA[[...] the query to make use of the virtual column, so in some cases it may be a better solution to use another trick suggested by J. Lewis: use &#8220;hand-made&#8221; histograms that provide a more realistic distribution. Of course, it [...]]]></description>
		<content:encoded><![CDATA[<p>[...] the query to make use of the virtual column, so in some cases it may be a better solution to use another trick suggested by J. Lewis: use &#8220;hand-made&#8221; histograms that provide a more realistic distribution. Of course, it [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FBI oddities &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/#comment-38740</link>
		<dc:creator><![CDATA[FBI oddities &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Thu, 16 Dec 2010 18:18:35 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1049#comment-38740</guid>
		<description><![CDATA[[...] huge number of closed orders; we&#8217;d also have to create a histogram on the column (possibly by writing a simple script) so that Oracle could recognise the skewed data [...]]]></description>
		<content:encoded><![CDATA[<p>[...] huge number of closed orders; we&#8217;d also have to create a histogram on the column (possibly by writing a simple script) so that Oracle could recognise the skewed data [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Local Indexes &#8211; 2 &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/#comment-37704</link>
		<dc:creator><![CDATA[Local Indexes &#8211; 2 &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Sun, 14 Nov 2010 17:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1049#comment-37704</guid>
		<description><![CDATA[[...] to help the optimizer in the most truthful way possible. List partitions (in a way similar to frequency histograms) are an obvious target for this type of [...]]]></description>
		<content:encoded><![CDATA[<p>[...] to help the optimizer in the most truthful way possible. List partitions (in a way similar to frequency histograms) are an obvious target for this type of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frequency Histograms &#8211; 6 &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/#comment-37574</link>
		<dc:creator><![CDATA[Frequency Histograms &#8211; 6 &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Wed, 20 Oct 2010 08:12:58 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1049#comment-37574</guid>
		<description><![CDATA[[...] solution, of course, is to write code to create a histogram that represents the situation as you want Oracle to see [...]]]></description>
		<content:encoded><![CDATA[<p>[...] solution, of course, is to write code to create a histogram that represents the situation as you want Oracle to see [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frequency Histogram 3 &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/#comment-37380</link>
		<dc:creator><![CDATA[Frequency Histogram 3 &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Fri, 24 Sep 2010 18:47:38 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1049#comment-37380</guid>
		<description><![CDATA[[...] Related reading: how to create an &#8220;artificial&#8221; frequency histogram. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Related reading: how to create an &#8220;artificial&#8221; frequency histogram. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fake Histograms &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/#comment-35862</link>
		<dc:creator><![CDATA[Fake Histograms &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Tue, 23 Mar 2010 20:49:14 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1049#comment-35862</guid>
		<description><![CDATA[[...] posted an example of creating a frequency histogram a few months ago &#8211; and it doesn&#8217;t take much to turn this into an example for the [...]]]></description>
		<content:encoded><![CDATA[<p>[...] posted an example of creating a frequency histogram a few months ago &#8211; and it doesn&#8217;t take much to turn this into an example for the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/#comment-35176</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 07 Jan 2010 21:55:02 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1049#comment-35176</guid>
		<description><![CDATA[Mike,

Very interesting. I wonder if it&#039;s deliberate or an accident. Certainly worth checking in 11g. [&lt;strong&gt;Update&lt;/strong&gt;: just ran your example in 11.1.0.6, and the effect does not appear there.]

This could be the answer to the concern I raised in the last paragraph about the increased complexity of imposing a selectivity for missing values - the old method will still work.

]]></description>
		<content:encoded><![CDATA[<p>Mike,</p>
<p>Very interesting. I wonder if it&#8217;s deliberate or an accident. Certainly worth checking in 11g. [<strong>Update</strong>: just ran your example in 11.1.0.6, and the effect does not appear there.]</p>
<p>This could be the answer to the concern I raised in the last paragraph about the increased complexity of imposing a selectivity for missing values &#8211; the old method will still work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Barratt</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/28/frequency-histograms/#comment-35170</link>
		<dc:creator><![CDATA[Mike Barratt]]></dc:creator>
		<pubDate>Thu, 07 Jan 2010 12:28:48 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1049#comment-35170</guid>
		<description><![CDATA[Hi Jonathan

It seems that you can force the old (pre 10.2.0.4) behavior by just getting and setting the stats for the column, without changing anything.  The only effect this appears to have is to set user_stats=&#039;YES&#039; on dba_tab_columns.  The 10053 trace does not give any clues as to why this works, it just seems to revert to using the column density again for missing histogram values, when user_stats=&#039;YES&#039;.

I don&#039;t know whether this is a bug or the intended behavior, but it gives you a finer grain of control by allowing you to choose the columns for which you want the old or the new behavior, without having to &quot;alter session set “_fix_control”=’5483301:off’&quot;.

The following test case demonstrates:

[sourcecode language=&quot;sql&quot;]
------------------ Start of test case.
drop table x
/

create table x as
select 1 code,object_name from all_objects where rownum&lt;=1000
union
select 2 code,object_name from all_objects where rownum&lt;=1000
union
select 4 code,object_name from all_objects where rownum&lt;=1000
;

exec dbms_stats.gather_table_stats(user,&#039;X&#039;,method_opt =&gt; &#039;FOR ALL COLUMNS SIZE 254&#039;);

set autotrace traceonly explain

select * from x where code=2 -- value in histogram
/

select * from x where code=3 -- missing value
/

DECLARE
	l_distcnt NUMBER DEFAULT NULL;
	l_density NUMBER DEFAULT NULL;
	l_nullcnt NUMBER DEFAULT NULL;
	l_srec    DBMS_STATS.STATREC;
	l_avgclen NUMBER DEFAULT NULL;

BEGIN

	DBMS_STATS.GET_COLUMN_STATS (
		ownname	=&gt;user,
		tabname	=&gt;&#039;X&#039;,
		colname	=&gt;&#039;CODE&#039;,
		distcnt	=&gt;l_distcnt,
		density	=&gt;l_density,
		nullcnt	=&gt;l_nullcnt,
		srec	=&gt;l_srec,
		avgclen	=&gt;l_avgclen
	);

	DBMS_STATS.SET_COLUMN_STATS(
		ownname =&gt;user,
		tabname =&gt;&#039;X&#039;,
		colname =&gt;&#039;CODE&#039;,
		distcnt =&gt;l_distcnt,
		density =&gt;l_density,
		nullcnt	=&gt;l_nullcnt,
		srec	=&gt;l_srec,
		avgclen	=&gt;l_avgclen
	);

END;
/

select * from x where code=3
/

------------------ End of test case.
[/sourcecode]
Here&#039;s the output:
[sourcecode]
SQL&gt; create table x as
  2  select 1 code,object_name from all_objects where rownum&lt;=1000
  3  union
  4  select 2 code,object_name from all_objects where rownum&lt;=1000
  5  union
  6  select 4 code,object_name from all_objects where rownum;=1000
  7  ;

Table created.

SQL&gt;
SQL&gt; exec dbms_stats.gather_table_stats(user,&#039;X&#039;,method_opt =&gt; &#039;FOR ALL COLUMNS SIZE 254&#039;);

PL/SQL procedure successfully completed.

SQL&gt;
SQL&gt; set autotrace traceonly explain
SQL&gt;
SQL&gt; select * from x where code=2   -- value in histogram
  2  /

Execution Plan
----------------------------------------------------------
Plan hash value: 2941724873

--------------------------------------------------------------------------
&#124; Id  &#124; Operation         &#124; Name &#124; Rows  &#124; Bytes &#124; Cost (%CPU)&#124; Time     &#124;
--------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT  &#124;      &#124;   992 &#124; 16864 &#124;     5   (0)&#124; 00:00:01 &#124;
&#124;*  1 &#124;  TABLE ACCESS FULL&#124; X    &#124;   992 &#124; 16864 &#124;     5   (0)&#124; 00:00:01 &#124;
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter(&quot;CODE&quot;=2)
--
--  Value in histogram, cardinality = 992
--
SQL&gt;
SQL&gt; select * from x where code=3   -- missing value
  2  /

Execution Plan
----------------------------------------------------------
Plan hash value: 2941724873

--------------------------------------------------------------------------
&#124; Id  &#124; Operation         &#124; Name &#124; Rows  &#124; Bytes &#124; Cost (%CPU)&#124; Time     &#124;
--------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT  &#124;      &#124;   496 &#124;  8432 &#124;     5   (0)&#124; 00:00:01 &#124;
&#124;*  1 &#124;  TABLE ACCESS FULL&#124; X    &#124;   496 &#124;  8432 &#124;     5   (0)&#124; 00:00:01 &#124;
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter(&quot;CODE&quot;=3)
--
--  Value not in histogram, cardinality = 496 i.e. half the least value, as expected 
--  for 10.2.0.4.
--

SQL&gt;
SQL&gt; DECLARE
  2       l_distcnt     NUMBER       DEFAULT NULL;
  3       l_density     NUMBER       DEFAULT NULL;
  4       l_nullcnt     NUMBER       DEFAULT NULL;
  5       l_srec        DBMS_STATS.STATREC;
  6       l_avgclen     NUMBER       DEFAULT NULL;
  7
  8    BEGIN
  9
 10    DBMS_STATS.GET_COLUMN_STATS (
 11       ownname=&gt; user,
 12       tabname=&gt; &#039;X&#039;,
 13       colname=&gt; &#039;CODE&#039;,
 14       distcnt=&gt; l_distcnt,
 15       density=&gt; l_density,
 16       nullcnt=&gt; l_nullcnt,
 17       srec=&gt; l_srec,
 18       avgclen=&gt; l_avgclen);
 19
 20    DBMS_STATS.SET_COLUMN_STATS(
 21       ownname=&gt; user,
 22       tabname=&gt; &#039;X&#039;,
 23       colname=&gt; &#039;CODE&#039;,
 24       distcnt=&gt; l_distcnt,
 25       density=&gt; l_density,
 26       nullcnt=&gt; l_nullcnt,
 27       srec=&gt; l_srec,
 28       avgclen=&gt; l_avgclen);
 29
 30    END;
 31  /

PL/SQL procedure successfully completed.

SQL&gt;
SQL&gt; select * from x where code=3
  2  /

Execution Plan
----------------------------------------------------------
Plan hash value: 2941724873

--------------------------------------------------------------------------
&#124; Id  &#124; Operation         &#124; Name &#124; Rows  &#124; Bytes &#124; Cost (%CPU)&#124; Time     &#124;
--------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT  &#124;      &#124;     1 &#124;    17 &#124;     5   (0)&#124; 00:00:01 &#124;
&#124;*  1 &#124;  TABLE ACCESS FULL&#124; X    &#124;     1 &#124;    17 &#124;     5   (0)&#124; 00:00:01 &#124;
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter(&quot;CODE&quot;=3)

--
--  Cardinality = 1 i.e. the pre 10.2.0.4 behavior.
--
[/sourcecode]
Regards,
Mike Barratt]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan</p>
<p>It seems that you can force the old (pre 10.2.0.4) behavior by just getting and setting the stats for the column, without changing anything.  The only effect this appears to have is to set user_stats=&#8217;YES&#8217; on dba_tab_columns.  The 10053 trace does not give any clues as to why this works, it just seems to revert to using the column density again for missing histogram values, when user_stats=&#8217;YES&#8217;.</p>
<p>I don&#8217;t know whether this is a bug or the intended behavior, but it gives you a finer grain of control by allowing you to choose the columns for which you want the old or the new behavior, without having to &#8220;alter session set “_fix_control”=’5483301:off’&#8221;.</p>
<p>The following test case demonstrates:</p>
<pre class="brush: sql; title: ; notranslate">
------------------ Start of test case.
drop table x
/

create table x as
select 1 code,object_name from all_objects where rownum&lt;=1000
union
select 2 code,object_name from all_objects where rownum&lt;=1000
union
select 4 code,object_name from all_objects where rownum&lt;=1000
;

exec dbms_stats.gather_table_stats(user,'X',method_opt =&gt; 'FOR ALL COLUMNS SIZE 254');

set autotrace traceonly explain

select * from x where code=2 -- value in histogram
/

select * from x where code=3 -- missing value
/

DECLARE
	l_distcnt NUMBER DEFAULT NULL;
	l_density NUMBER DEFAULT NULL;
	l_nullcnt NUMBER DEFAULT NULL;
	l_srec    DBMS_STATS.STATREC;
	l_avgclen NUMBER DEFAULT NULL;

BEGIN

	DBMS_STATS.GET_COLUMN_STATS (
		ownname	=&gt;user,
		tabname	=&gt;'X',
		colname	=&gt;'CODE',
		distcnt	=&gt;l_distcnt,
		density	=&gt;l_density,
		nullcnt	=&gt;l_nullcnt,
		srec	=&gt;l_srec,
		avgclen	=&gt;l_avgclen
	);

	DBMS_STATS.SET_COLUMN_STATS(
		ownname =&gt;user,
		tabname =&gt;'X',
		colname =&gt;'CODE',
		distcnt =&gt;l_distcnt,
		density =&gt;l_density,
		nullcnt	=&gt;l_nullcnt,
		srec	=&gt;l_srec,
		avgclen	=&gt;l_avgclen
	);

END;
/

select * from x where code=3
/

------------------ End of test case.
</pre>
<p>Here&#8217;s the output:</p>
<pre class="brush: plain; title: ; notranslate">
SQL&gt; create table x as
  2  select 1 code,object_name from all_objects where rownum&amp;lt;=1000
  3  union
  4  select 2 code,object_name from all_objects where rownum&amp;lt;=1000
  5  union
  6  select 4 code,object_name from all_objects where rownum;=1000
  7  ;

Table created.

SQL&gt;
SQL&gt; exec dbms_stats.gather_table_stats(user,'X',method_opt =&gt; 'FOR ALL COLUMNS SIZE 254');

PL/SQL procedure successfully completed.

SQL&gt;
SQL&gt; set autotrace traceonly explain
SQL&gt;
SQL&gt; select * from x where code=2   -- value in histogram
  2  /

Execution Plan
----------------------------------------------------------
Plan hash value: 2941724873

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |   992 | 16864 |     5   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| X    |   992 | 16864 |     5   (0)| 00:00:01 |
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter(&quot;CODE&quot;=2)
--
--  Value in histogram, cardinality = 992
--
SQL&gt;
SQL&gt; select * from x where code=3   -- missing value
  2  /

Execution Plan
----------------------------------------------------------
Plan hash value: 2941724873

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |   496 |  8432 |     5   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| X    |   496 |  8432 |     5   (0)| 00:00:01 |
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter(&quot;CODE&quot;=3)
--
--  Value not in histogram, cardinality = 496 i.e. half the least value, as expected 
--  for 10.2.0.4.
--

SQL&gt;
SQL&gt; DECLARE
  2       l_distcnt     NUMBER       DEFAULT NULL;
  3       l_density     NUMBER       DEFAULT NULL;
  4       l_nullcnt     NUMBER       DEFAULT NULL;
  5       l_srec        DBMS_STATS.STATREC;
  6       l_avgclen     NUMBER       DEFAULT NULL;
  7
  8    BEGIN
  9
 10    DBMS_STATS.GET_COLUMN_STATS (
 11       ownname=&gt; user,
 12       tabname=&gt; 'X',
 13       colname=&gt; 'CODE',
 14       distcnt=&gt; l_distcnt,
 15       density=&gt; l_density,
 16       nullcnt=&gt; l_nullcnt,
 17       srec=&gt; l_srec,
 18       avgclen=&gt; l_avgclen);
 19
 20    DBMS_STATS.SET_COLUMN_STATS(
 21       ownname=&gt; user,
 22       tabname=&gt; 'X',
 23       colname=&gt; 'CODE',
 24       distcnt=&gt; l_distcnt,
 25       density=&gt; l_density,
 26       nullcnt=&gt; l_nullcnt,
 27       srec=&gt; l_srec,
 28       avgclen=&gt; l_avgclen);
 29
 30    END;
 31  /

PL/SQL procedure successfully completed.

SQL&gt;
SQL&gt; select * from x where code=3
  2  /

Execution Plan
----------------------------------------------------------
Plan hash value: 2941724873

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |     1 |    17 |     5   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| X    |     1 |    17 |     5   (0)| 00:00:01 |
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter(&quot;CODE&quot;=3)

--
--  Cardinality = 1 i.e. the pre 10.2.0.4 behavior.
--
</pre>
<p>Regards,<br />
Mike Barratt</p>
]]></content:encoded>
	</item>
</channel>
</rss>
