<?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: Dynamic Sampling</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Sat, 18 May 2013 11:04:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Dynamic Sampling: Use,Levels,10g-11g behavior, &#171; SureshGandhi</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/#comment-50665</link>
		<dc:creator><![CDATA[Dynamic Sampling: Use,Levels,10g-11g behavior, &#171; SureshGandhi]]></dc:creator>
		<pubDate>Sun, 07 Oct 2012 07:31:54 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=3185#comment-50665</guid>
		<description><![CDATA[[...] Source:- http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/ [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Source:- <a href="http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/" rel="nofollow">http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dynamic sampling pitfalls &#171; savvinov</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/#comment-43455</link>
		<dc:creator><![CDATA[Dynamic sampling pitfalls &#171; savvinov]]></dc:creator>
		<pubDate>Wed, 21 Dec 2011 10:57:11 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=3185#comment-43455</guid>
		<description><![CDATA[[...] http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/  http://oracle-randolf.blogspot.com/2011/06/dynamic-sampling-public-synonyms-and.html   Share this:TwitterFacebookLike this:LikeBe the first to like this post. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] <a href="http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/" rel="nofollow">http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/</a>  <a href="http://oracle-randolf.blogspot.com/2011/06/dynamic-sampling-public-synonyms-and.html" rel="nofollow">http://oracle-randolf.blogspot.com/2011/06/dynamic-sampling-public-synonyms-and.html</a>   Share this:TwitterFacebookLike this:LikeBe the first to like this post. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/#comment-40381</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 20 Apr 2011 14:00:51 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=3185#comment-40381</guid>
		<description><![CDATA[Davide,

I don&#039;t have any better knowledge than you do on this aspect of sampling.  Your notes prompted me to set up a table with 1,000 partitions and try a few quick tests using the dynamic_sampling hint running through the levels 1 to 9 (which - in the hint form - start Oracle with 32 blocks and then keep doubling up).

The results were interesting - variations on large percentages of a selection of partiitons to very small percentages of the whole table.  And some of the results certainly looked consistent with your suggestions.

It could be useful to work out more detail, but I think that I&#039;d probably want to force larger sample sizes anyway when looking at large partitioned tables, so working at the bottom end of the sample size might be counterproductive.]]></description>
		<content:encoded><![CDATA[<p>Davide,</p>
<p>I don&#8217;t have any better knowledge than you do on this aspect of sampling.  Your notes prompted me to set up a table with 1,000 partitions and try a few quick tests using the dynamic_sampling hint running through the levels 1 to 9 (which &#8211; in the hint form &#8211; start Oracle with 32 blocks and then keep doubling up).</p>
<p>The results were interesting &#8211; variations on large percentages of a selection of partiitons to very small percentages of the whole table.  And some of the results certainly looked consistent with your suggestions.</p>
<p>It could be useful to work out more detail, but I think that I&#8217;d probably want to force larger sample sizes anyway when looking at large partitioned tables, so working at the bottom end of the sample size might be counterproductive.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davide Gislon</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/#comment-40313</link>
		<dc:creator><![CDATA[Davide Gislon]]></dc:creator>
		<pubDate>Mon, 11 Apr 2011 09:18:47 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=3185#comment-40313</guid>
		<description><![CDATA[Hi Jonathan,
I forgot to mention that the Oracle version where I ran my testing is 10.2.0.5, using ASSM.

Thanks,
Davide]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,<br />
I forgot to mention that the Oracle version where I ran my testing is 10.2.0.5, using ASSM.</p>
<p>Thanks,<br />
Davide</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davide Gislon</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/#comment-40244</link>
		<dc:creator><![CDATA[Davide Gislon]]></dc:creator>
		<pubDate>Fri, 08 Apr 2011 16:27:58 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=3185#comment-40244</guid>
		<description><![CDATA[Hi Jonathan,
I came across an issue when using dynamic_sampling on partitioned tables where the optimizer selectivity estimation resulted to be very poor.
After detailed analysis I came up with a guess that I explain below.
I was thinking that if you have a chance to read it you might be able to confirm or rectify this theory.

Regards,
Davide


DYNAMIC_SAMPLING BEHAVIOUR ON PARTITIONED TABLES

In the case of a partitioned table the dynamic_sampling engine behaves in a way that will be described below and that can be harmful in specific cases.
The dinamic_sampling level, set at query level using the dynamic_sampling hint or at database level setting the parameter optimizer_dynamic_sampling, indicates in addition to other information how many blocks need to be sampled.
Let&#039;s call this value as N.
I have observed tracing the 10053 event that the actual sampled blocks in the case of a non-partitioned table is N-1, so I am assuming that one of the sampled blocks is the segment header that is probably needed to be read to randomly choose the actual blocks to be sampled.

In the case of a partitioned table I have observed the following behavior of the optimizer.
Assuming that &quot;p&quot; is the number of partitons hit by the query and &quot;N&quot; is the number of blocks to be sampled as indicated by the dynamic_sampling level, the optimizer will calculate the actual number of blocks to be sampled (&quot;n&quot;) as follows:

if p  n=(N-p)
if p &gt;= N --&gt; n=N/2

I have explained this with the following theory:
when oracle uses the SAMPLE clause in a select statement (which is used in the sample query generated by the optimizer) it will not consider the segment header, which I assume is needed to be read to randomly choose the sampled blocks, to be included in the required percentage.
In the case of a partitioned table the number of segment headers read is equal to the number of the partitions hit by the query.
When using dynamic_sampling the optimizer doesn&#039;t want to read extra blocks other than what indicated by the dynamic_sampling level, so it will calculate the percentage to be used in the SAMPLE clause considering the number of actual sampled blocks, which is the number of blocks indicated by the dynamic_sampling level (N) less the number of segment headers to be read.
In this case it will meake sure than the sample query will not read more than N blocks (segment headers included).
In the previous formulae if p = N the calculation N-p would give a number less or equal to 0 leading to an inappropriate value to be used in the SAMPLE clause. That&#039;s why it defaults to a number of actual sampled blocks equal to N/2 (and indeed the sample query generated is an union of different SELECT statements hitting different partitons to a total of N/2).

Below there are some excerpts from the various 10053 trace files.
In all the cases the database parameter optimizer_dynamic_sampling was set to 4, which indicates that 32 is the number of blocks to be sampled:

1. Query hitting 1 partition:
    total partitions : 1
      partitions for sampling : 1
    ...
    max. sample block cnt. : 32
    sample block cnt. : 31

2. Query hitting 2 partitions:
    total partitions : 1932
      partitions for sampling : 2
    ...
    max. sample block cnt. : 32
    sample block cnt. : 30

3. Query hitting 31 partitions:
    total partitions : 1932
      partitions for sampling : 31
    ...
    max. sample block cnt. : 32
    sample block cnt. : 1

4. Query hitting 32 partitions:
    total partitions : 1932
      partitions for sampling : 32
      partitions actually sampled from : 16
      partitioning pct. : 1.655458
    ...
    max. sample block cnt. : 32
    sample block cnt. : 16

5. Query hitting 45 partitions:
    total partitions : 1932
      partitions for sampling : 45
      partitions actually sampled from : 16
      partitioning pct. : 2.329193
    ...
    max. sample block cnt. : 32
    sample block cnt. : 16

In the above excerpts &quot;max. sample block cnt.&quot; is the number of blocks to be sampled set by the dynamic_samplic level (our &quot;N&quot; variable), the &quot;partitions for sampling&quot; is the number of partitions hit by the query (our &quot;p&quot; variable) and &quot;sample block cnt.&quot; is the actual sampled blocks (our &quot;n&quot; variable).

You will see that when p is very close to N (i.e. excerpt number 3) we have a very small blocks actually used in the sample query, and this can unfortunately lead to an inaccurate estimation by the optimizer.]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,<br />
I came across an issue when using dynamic_sampling on partitioned tables where the optimizer selectivity estimation resulted to be very poor.<br />
After detailed analysis I came up with a guess that I explain below.<br />
I was thinking that if you have a chance to read it you might be able to confirm or rectify this theory.</p>
<p>Regards,<br />
Davide</p>
<p>DYNAMIC_SAMPLING BEHAVIOUR ON PARTITIONED TABLES</p>
<p>In the case of a partitioned table the dynamic_sampling engine behaves in a way that will be described below and that can be harmful in specific cases.<br />
The dinamic_sampling level, set at query level using the dynamic_sampling hint or at database level setting the parameter optimizer_dynamic_sampling, indicates in addition to other information how many blocks need to be sampled.<br />
Let&#8217;s call this value as N.<br />
I have observed tracing the 10053 event that the actual sampled blocks in the case of a non-partitioned table is N-1, so I am assuming that one of the sampled blocks is the segment header that is probably needed to be read to randomly choose the actual blocks to be sampled.</p>
<p>In the case of a partitioned table I have observed the following behavior of the optimizer.<br />
Assuming that &#8220;p&#8221; is the number of partitons hit by the query and &#8220;N&#8221; is the number of blocks to be sampled as indicated by the dynamic_sampling level, the optimizer will calculate the actual number of blocks to be sampled (&#8220;n&#8221;) as follows:</p>
<p>if p  n=(N-p)<br />
if p &gt;= N &#8211;&gt; n=N/2</p>
<p>I have explained this with the following theory:<br />
when oracle uses the SAMPLE clause in a select statement (which is used in the sample query generated by the optimizer) it will not consider the segment header, which I assume is needed to be read to randomly choose the sampled blocks, to be included in the required percentage.<br />
In the case of a partitioned table the number of segment headers read is equal to the number of the partitions hit by the query.<br />
When using dynamic_sampling the optimizer doesn&#8217;t want to read extra blocks other than what indicated by the dynamic_sampling level, so it will calculate the percentage to be used in the SAMPLE clause considering the number of actual sampled blocks, which is the number of blocks indicated by the dynamic_sampling level (N) less the number of segment headers to be read.<br />
In this case it will meake sure than the sample query will not read more than N blocks (segment headers included).<br />
In the previous formulae if p = N the calculation N-p would give a number less or equal to 0 leading to an inappropriate value to be used in the SAMPLE clause. That&#8217;s why it defaults to a number of actual sampled blocks equal to N/2 (and indeed the sample query generated is an union of different SELECT statements hitting different partitons to a total of N/2).</p>
<p>Below there are some excerpts from the various 10053 trace files.<br />
In all the cases the database parameter optimizer_dynamic_sampling was set to 4, which indicates that 32 is the number of blocks to be sampled:</p>
<p>1. Query hitting 1 partition:<br />
    total partitions : 1<br />
      partitions for sampling : 1<br />
    &#8230;<br />
    max. sample block cnt. : 32<br />
    sample block cnt. : 31</p>
<p>2. Query hitting 2 partitions:<br />
    total partitions : 1932<br />
      partitions for sampling : 2<br />
    &#8230;<br />
    max. sample block cnt. : 32<br />
    sample block cnt. : 30</p>
<p>3. Query hitting 31 partitions:<br />
    total partitions : 1932<br />
      partitions for sampling : 31<br />
    &#8230;<br />
    max. sample block cnt. : 32<br />
    sample block cnt. : 1</p>
<p>4. Query hitting 32 partitions:<br />
    total partitions : 1932<br />
      partitions for sampling : 32<br />
      partitions actually sampled from : 16<br />
      partitioning pct. : 1.655458<br />
    &#8230;<br />
    max. sample block cnt. : 32<br />
    sample block cnt. : 16</p>
<p>5. Query hitting 45 partitions:<br />
    total partitions : 1932<br />
      partitions for sampling : 45<br />
      partitions actually sampled from : 16<br />
      partitioning pct. : 2.329193<br />
    &#8230;<br />
    max. sample block cnt. : 32<br />
    sample block cnt. : 16</p>
<p>In the above excerpts &#8220;max. sample block cnt.&#8221; is the number of blocks to be sampled set by the dynamic_samplic level (our &#8220;N&#8221; variable), the &#8220;partitions for sampling&#8221; is the number of partitions hit by the query (our &#8220;p&#8221; variable) and &#8220;sample block cnt.&#8221; is the actual sampled blocks (our &#8220;n&#8221; variable).</p>
<p>You will see that when p is very close to N (i.e. excerpt number 3) we have a very small blocks actually used in the sample query, and this can unfortunately lead to an inaccurate estimation by the optimizer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/#comment-40186</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 31 Mar 2011 16:34:46 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=3185#comment-40186</guid>
		<description><![CDATA[Ahmed,

It looks as if you may be interested in values which are only &quot;a little more popular&quot; than average - which means Oracle doesn&#039;t notice the special cases until you take a very large sample (which - in your case - has to be 100%).

However, you could try adding the hint &lt;em&gt;&lt;strong&gt;dynamic_sampling_est_cdn()&lt;/strong&gt;&lt;/em&gt; to your code. This was documented in the 9.2 manuals, but seems to have disappeared from the 10g manuals.
]]></description>
		<content:encoded><![CDATA[<p>Ahmed,</p>
<p>It looks as if you may be interested in values which are only &#8220;a little more popular&#8221; than average &#8211; which means Oracle doesn&#8217;t notice the special cases until you take a very large sample (which &#8211; in your case &#8211; has to be 100%).</p>
<p>However, you could try adding the hint <em><strong>dynamic_sampling_est_cdn()</strong></em> to your code. This was documented in the 9.2 manuals, but seems to have disappeared from the 10g manuals.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahmed AANGOUR</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/#comment-40178</link>
		<dc:creator><![CDATA[Ahmed AANGOUR]]></dc:creator>
		<pubDate>Wed, 30 Mar 2011 12:48:48 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=3185#comment-40178</guid>
		<description><![CDATA[Hi Jonathan,

Do you know a trick to force the CBO to use Dynamic sampling results instead of object statistics?
I would like to use dynamic sampling on a table but just for one query and without having to delete statistics.
Unless I use Dynamic Sampling at level 10, I can&#039;t reach this goal. With level &lt;10 Dynamic sampling is performed but is not taken into account in the selectivity calculation.
[sourcecode]
SQL&gt; explain plan for
  2  select /*+ dynamic_sampling(m 10) */ count(*) from  MUT_OBJECTS m where OBJ_PARENT_ID = 79249575;
  
 
Explained
 
SQL&gt; select * from table(dbms_xplan.display);
 
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 2416190520
-------------------------------------------------------------------
&#124; Id  &#124; Operation         &#124; Name          &#124; Rows  &#124; Bytes &#124; Cost  &#124;
-------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT  &#124;               &#124;     1 &#124;     6 &#124;     1 &#124;
&#124;   1 &#124;  SORT AGGREGATE   &#124;               &#124;     1 &#124;     6 &#124;       &#124;
&#124;*  2 &#124;   INDEX RANGE SCAN&#124; IDX_PARENT_ID &#124;  1069 &#124;  6414 &#124;     1 &#124;
-------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access(&quot;OBJ_PARENT_ID&quot;=79249575)
Note
-----
   - cpu costing is off (consider enabling it)
   - dynamic sampling used for this statement


SQL&gt; explain plan for select /*+ dynamic_sampling(m 9) */ count(*) from  MUT_OBJECTS m where OBJ_PARENT_ID = 79249575;
 
Explained
 
SQL&gt; select * from table(dbms_xplan.display);
 
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 2416190520
-------------------------------------------------------------------
&#124; Id  &#124; Operation         &#124; Name          &#124; Rows  &#124; Bytes &#124; Cost  &#124;
-------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT  &#124;               &#124;     1 &#124;     6 &#124;     1 &#124;
&#124;   1 &#124;  SORT AGGREGATE   &#124;               &#124;     1 &#124;     6 &#124;       &#124;
&#124;*  2 &#124;   INDEX RANGE SCAN&#124; IDX_PARENT_ID &#124;     3 &#124;    18 &#124;     1 &#124;
-------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access(&quot;OBJ_PARENT_ID&quot;=79249575)
Note
-----
   - cpu costing is off (consider enabling it)
 
18 rows selected

[/sourcecode]
Thanks for your help]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>Do you know a trick to force the CBO to use Dynamic sampling results instead of object statistics?<br />
I would like to use dynamic sampling on a table but just for one query and without having to delete statistics.<br />
Unless I use Dynamic Sampling at level 10, I can&#8217;t reach this goal. With level &lt;10 Dynamic sampling is performed but is not taken into account in the selectivity calculation.</p>
<pre class="brush: plain; title: ; notranslate">
SQL&gt; explain plan for
  2  select /*+ dynamic_sampling(m 10) */ count(*) from  MUT_OBJECTS m where OBJ_PARENT_ID = 79249575;
  
 
Explained
 
SQL&gt; select * from table(dbms_xplan.display);
 
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 2416190520
-------------------------------------------------------------------
| Id  | Operation         | Name          | Rows  | Bytes | Cost  |
-------------------------------------------------------------------
|   0 | SELECT STATEMENT  |               |     1 |     6 |     1 |
|   1 |  SORT AGGREGATE   |               |     1 |     6 |       |
|*  2 |   INDEX RANGE SCAN| IDX_PARENT_ID |  1069 |  6414 |     1 |
-------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access(&quot;OBJ_PARENT_ID&quot;=79249575)
Note
-----
   - cpu costing is off (consider enabling it)
   - dynamic sampling used for this statement


SQL&gt; explain plan for select /*+ dynamic_sampling(m 9) */ count(*) from  MUT_OBJECTS m where OBJ_PARENT_ID = 79249575;
 
Explained
 
SQL&gt; select * from table(dbms_xplan.display);
 
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 2416190520
-------------------------------------------------------------------
| Id  | Operation         | Name          | Rows  | Bytes | Cost  |
-------------------------------------------------------------------
|   0 | SELECT STATEMENT  |               |     1 |     6 |     1 |
|   1 |  SORT AGGREGATE   |               |     1 |     6 |       |
|*  2 |   INDEX RANGE SCAN| IDX_PARENT_ID |     3 |    18 |     1 |
-------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access(&quot;OBJ_PARENT_ID&quot;=79249575)
Note
-----
   - cpu costing is off (consider enabling it)
 
18 rows selected

</pre>
<p>Thanks for your help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narasimha</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/#comment-37307</link>
		<dc:creator><![CDATA[Narasimha]]></dc:creator>
		<pubDate>Wed, 15 Sep 2010 14:39:06 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=3185#comment-37307</guid>
		<description><![CDATA[Does the dynamic sampling supports AS OF SCN.

[sourcecode]
tst_pre_eod@MIFEX3&gt; SELECT ParticipantID, BoardID, InstrumentID, MMListAction FROM
         TIBEX_MEMMHybridAdmView as of scn 6148947776 WHERE MEGroupID = &#039;ME1&#039;
         ORDER BY Timestamp ASC  2    3
  4  /

Execution Plan
----------------------------------------------------------
Plan hash value: 39089053

-------------------------------------------------------------------------------------------------------------
&#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;   159 &#124;    88   (3)&#124; 00:00:02 &#124;
&#124;   1 &#124;  SORT ORDER BY                &#124;                             &#124;     1 &#124;   159 &#124;    88   (3)&#124; 00:00:02 &#124;
&#124;   2 &#124;   NESTED LOOPS                &#124;                             &#124;     1 &#124;   159 &#124;    87   (2)&#124; 00:00:02 &#124;
&#124;*  3 &#124;    HASH JOIN                  &#124;                             &#124;    60 &#124;  3780 &#124;    86   (2)&#124; 00:00:02 &#124;
&#124;*  4 &#124;     TABLE ACCESS FULL         &#124; TIBEX_INSTRUMENT            &#124;    47 &#124;  1598 &#124;    59   (0)&#124; 00:00:01 &#124;
&#124;   5 &#124;     SORT UNIQUE               &#124;                             &#124;  2361 &#124; 68469 &#124;    26   (0)&#124; 00:00:01 &#124;
&#124;*  6 &#124;      INDEX FAST FULL SCAN     &#124; XPKTIBEX_ADMINACK           &#124;  2361 &#124; 68469 &#124;    26   (0)&#124; 00:00:01 &#124;
&#124;*  7 &#124;    TABLE ACCESS BY INDEX ROWID&#124; TIBEX_HYBRIDMMINSTRADMIN    &#124;     1 &#124;    96 &#124;     1   (0)&#124; 00:00:01 &#124;
&#124;*  8 &#124;     INDEX UNIQUE SCAN         &#124; XPKTIBEX_HYBRIDMMINSTRADMIN &#124;     1 &#124;       &#124;     0   (0)&#124; 00:00:01 &#124;
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;B&quot;.&quot;MEGROUPID&quot;=&quot;C&quot;.&quot;SERVERID&quot;)
   4 - filter(&quot;B&quot;.&quot;MEGROUPID&quot;=&#039;ME1&#039;)
   6 - filter(&quot;C&quot;.&quot;SERVERID&quot;=&#039;ME1&#039;)
   7 - filter(&quot;A&quot;.&quot;INSTRUMENTID&quot;=&quot;B&quot;.&quot;INSTRUMENTID&quot;)
   8 - access(&quot;A&quot;.&quot;ADMINID&quot;=&quot;C&quot;.&quot;ADMINID&quot;)

tst_pre_eod@MIFEX3&gt; SELECT ParticipantID, BoardID, InstrumentID, MMListAction FROM
         TIBEX_MEMMHybridAdmView  WHERE MEGroupID = &#039;ME1&#039;
         ORDER BY Timestamp ASC;  2    3

Execution Plan
----------------------------------------------------------
Plan hash value: 1706923895

-----------------------------------------------------------------------------------------------------------
&#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;   159 &#124;     5  (20)&#124; 00:00:01 &#124;
&#124;   1 &#124;  SORT ORDER BY                 &#124;                          &#124;     1 &#124;   159 &#124;     5  (20)&#124; 00:00:01 &#124;
&#124;   2 &#124;   NESTED LOOPS SEMI            &#124;                          &#124;     1 &#124;   159 &#124;     4   (0)&#124; 00:00:01 &#124;
&#124;   3 &#124;    NESTED LOOPS                &#124;                          &#124;     1 &#124;   130 &#124;     3   (0)&#124; 00:00:01 &#124;
&#124;   4 &#124;     TABLE ACCESS FULL          &#124; TIBEX_HYBRIDMMINSTRADMIN &#124;     1 &#124;    96 &#124;     2   (0)&#124; 00:00:01 &#124;
&#124;*  5 &#124;     TABLE ACCESS BY INDEX ROWID&#124; TIBEX_INSTRUMENT         &#124;     1 &#124;    34 &#124;     1   (0)&#124; 00:00:01 &#124;
&#124;*  6 &#124;      INDEX UNIQUE SCAN         &#124; XPKTIBEX_INSTRUMENT      &#124;     1 &#124;       &#124;     0   (0)&#124; 00:00:01 &#124;
&#124;*  7 &#124;    INDEX RANGE SCAN            &#124; XPKTIBEX_ADMINACK        &#124;   134K&#124;  3799K&#124;     1   (0)&#124; 00:00:01 &#124;
-----------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - filter(&quot;B&quot;.&quot;MEGROUPID&quot;=&#039;ME1&#039;)
   6 - access(&quot;A&quot;.&quot;INSTRUMENTID&quot;=&quot;B&quot;.&quot;INSTRUMENTID&quot;)
   7 - access(&quot;A&quot;.&quot;ADMINID&quot;=&quot;C&quot;.&quot;ADMINID&quot; AND &quot;C&quot;.&quot;SERVERID&quot;=&#039;ME1&#039;)
       filter(&quot;B&quot;.&quot;MEGROUPID&quot;=&quot;C&quot;.&quot;SERVERID&quot;)

Note
-----
   - dynamic sampling used for this statement
[/sourcecode]
]]></description>
		<content:encoded><![CDATA[<p>Does the dynamic sampling supports AS OF SCN.</p>
<pre class="brush: plain; title: ; notranslate">
tst_pre_eod@MIFEX3&amp;gt; SELECT ParticipantID, BoardID, InstrumentID, MMListAction FROM
         TIBEX_MEMMHybridAdmView as of scn 6148947776 WHERE MEGroupID = 'ME1'
         ORDER BY Timestamp ASC  2    3
  4  /

Execution Plan
----------------------------------------------------------
Plan hash value: 39089053

-------------------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name                        | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |                             |     1 |   159 |    88   (3)| 00:00:02 |
|   1 |  SORT ORDER BY                |                             |     1 |   159 |    88   (3)| 00:00:02 |
|   2 |   NESTED LOOPS                |                             |     1 |   159 |    87   (2)| 00:00:02 |
|*  3 |    HASH JOIN                  |                             |    60 |  3780 |    86   (2)| 00:00:02 |
|*  4 |     TABLE ACCESS FULL         | TIBEX_INSTRUMENT            |    47 |  1598 |    59   (0)| 00:00:01 |
|   5 |     SORT UNIQUE               |                             |  2361 | 68469 |    26   (0)| 00:00:01 |
|*  6 |      INDEX FAST FULL SCAN     | XPKTIBEX_ADMINACK           |  2361 | 68469 |    26   (0)| 00:00:01 |
|*  7 |    TABLE ACCESS BY INDEX ROWID| TIBEX_HYBRIDMMINSTRADMIN    |     1 |    96 |     1   (0)| 00:00:01 |
|*  8 |     INDEX UNIQUE SCAN         | XPKTIBEX_HYBRIDMMINSTRADMIN |     1 |       |     0   (0)| 00:00:01 |
-------------------------------------------------------------------------------------------------------------

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

   3 - access(&quot;B&quot;.&quot;MEGROUPID&quot;=&quot;C&quot;.&quot;SERVERID&quot;)
   4 - filter(&quot;B&quot;.&quot;MEGROUPID&quot;='ME1')
   6 - filter(&quot;C&quot;.&quot;SERVERID&quot;='ME1')
   7 - filter(&quot;A&quot;.&quot;INSTRUMENTID&quot;=&quot;B&quot;.&quot;INSTRUMENTID&quot;)
   8 - access(&quot;A&quot;.&quot;ADMINID&quot;=&quot;C&quot;.&quot;ADMINID&quot;)

tst_pre_eod@MIFEX3&amp;gt; SELECT ParticipantID, BoardID, InstrumentID, MMListAction FROM
         TIBEX_MEMMHybridAdmView  WHERE MEGroupID = 'ME1'
         ORDER BY Timestamp ASC;  2    3

Execution Plan
----------------------------------------------------------
Plan hash value: 1706923895

-----------------------------------------------------------------------------------------------------------
| Id  | Operation                      | Name                     | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT               |                          |     1 |   159 |     5  (20)| 00:00:01 |
|   1 |  SORT ORDER BY                 |                          |     1 |   159 |     5  (20)| 00:00:01 |
|   2 |   NESTED LOOPS SEMI            |                          |     1 |   159 |     4   (0)| 00:00:01 |
|   3 |    NESTED LOOPS                |                          |     1 |   130 |     3   (0)| 00:00:01 |
|   4 |     TABLE ACCESS FULL          | TIBEX_HYBRIDMMINSTRADMIN |     1 |    96 |     2   (0)| 00:00:01 |
|*  5 |     TABLE ACCESS BY INDEX ROWID| TIBEX_INSTRUMENT         |     1 |    34 |     1   (0)| 00:00:01 |
|*  6 |      INDEX UNIQUE SCAN         | XPKTIBEX_INSTRUMENT      |     1 |       |     0   (0)| 00:00:01 |
|*  7 |    INDEX RANGE SCAN            | XPKTIBEX_ADMINACK        |   134K|  3799K|     1   (0)| 00:00:01 |
-----------------------------------------------------------------------------------------------------------

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

   5 - filter(&quot;B&quot;.&quot;MEGROUPID&quot;='ME1')
   6 - access(&quot;A&quot;.&quot;INSTRUMENTID&quot;=&quot;B&quot;.&quot;INSTRUMENTID&quot;)
   7 - access(&quot;A&quot;.&quot;ADMINID&quot;=&quot;C&quot;.&quot;ADMINID&quot; AND &quot;C&quot;.&quot;SERVERID&quot;='ME1')
       filter(&quot;B&quot;.&quot;MEGROUPID&quot;=&quot;C&quot;.&quot;SERVERID&quot;)

Note
-----
   - dynamic sampling used for this statement
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cardinalilty One &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/#comment-37032</link>
		<dc:creator><![CDATA[Cardinalilty One &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Sun, 22 Aug 2010 18:37:47 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=3185#comment-37032</guid>
		<description><![CDATA[[...] first workaround is to add a hint to force Oracle to take a dynamic sample of the critical table. In this case I&#8217;ve instructed Oracle to use a 64 block sample. For [...]]]></description>
		<content:encoded><![CDATA[<p>[...] first workaround is to add a hint to force Oracle to take a dynamic sample of the critical table. In this case I&#8217;ve instructed Oracle to use a 64 block sample. For [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christophe Kervoazou</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/23/dynamic-sampling/#comment-36970</link>
		<dc:creator><![CDATA[Christophe Kervoazou]]></dc:creator>
		<pubDate>Thu, 12 Aug 2010 18:16:10 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=3185#comment-36970</guid>
		<description><![CDATA[Jonathan,

Really sorry for my mistake. It&#039;s true that in this case, there is nothing special :).
In fact, my lack of understanding appears when I insert a very differnt amount of rows (10 000 rows or more by example)in the table.
In this case, there is no sampling(confirm by the note in xplan) and statistic seems to be used(cardinality 1000) in spite of the hint.
When the table contains data, behaviour of the hint is not the same?

You are right it&#039;s probably the same &quot;problem&quot; but in my case,no delete , CBO should not be mistaken. 

Sorry again

Regards]]></description>
		<content:encoded><![CDATA[<p>Jonathan,</p>
<p>Really sorry for my mistake. It&#8217;s true that in this case, there is nothing special :).<br />
In fact, my lack of understanding appears when I insert a very differnt amount of rows (10 000 rows or more by example)in the table.<br />
In this case, there is no sampling(confirm by the note in xplan) and statistic seems to be used(cardinality 1000) in spite of the hint.<br />
When the table contains data, behaviour of the hint is not the same?</p>
<p>You are right it&#8217;s probably the same &#8220;problem&#8221; but in my case,no delete , CBO should not be mistaken. </p>
<p>Sorry again</p>
<p>Regards</p>
]]></content:encoded>
	</item>
</channel>
</rss>
