<?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/"
		>
<channel>
	<title>Comments on: Impact of Direct Reads on Delayed Block Cleanouts</title>
	<atom:link href="http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/feed/" rel="self" type="application/rss+xml" />
	<link>http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/</link>
	<description></description>
	<lastBuildDate>Fri, 27 Jan 2012 07:31:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Christian Antognini</title>
		<link>http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/comment-page-1/#comment-34900</link>
		<dc:creator>Christian Antognini</dc:creator>
		<pubDate>Mon, 05 Sep 2011 08:10:07 +0000</pubDate>
		<guid isPermaLink="false">http://antognini.ch/?p=393#comment-34900</guid>
		<description>Hi Ksun

I would not expect something different in such a case...

Cheers,
Chris</description>
		<content:encoded><![CDATA[<p>Hi Ksun</p>
<p>I would not expect something different in such a case&#8230;</p>
<p>Cheers,<br />
Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ksun</title>
		<link>http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/comment-page-1/#comment-34747</link>
		<dc:creator>ksun</dc:creator>
		<pubDate>Fri, 02 Sep 2011 08:56:18 +0000</pubDate>
		<guid isPermaLink="false">http://antognini.ch/?p=393#comment-34747</guid>
		<description>Ciao Chris,

I try to think the impact on real applications, thus extract a testcase:

&lt;pre&gt;
create table t2 as select rownum id from dual connect by level &lt;= 100;

select /*+ leading(t2) use_nl(t) */ count(*) from t, t2; 
&lt;/pre&gt;

it seems that &quot;physical reads direct&quot; of table t repeats 100 times (100 * 10003)
due to the 100 nested loops on t.</description>
		<content:encoded><![CDATA[<p>Ciao Chris,</p>
<p>I try to think the impact on real applications, thus extract a testcase:</p>
<p><pre>
create table t2 as select rownum id from dual connect by level &lt;= 100;

select /*+ leading(t2) use_nl(t) */ count(*) from t, t2; 
</pre></p>
<p>it seems that &#8220;physical reads direct&#8221; of table t repeats 100 times (100 * 10003)<br />
due to the 100 nested loops on t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: אתגר החודש – אתגר מאי 2011 - Israel Database Portal</title>
		<link>http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/comment-page-1/#comment-23452</link>
		<dc:creator>אתגר החודש – אתגר מאי 2011 - Israel Database Portal</dc:creator>
		<pubDate>Wed, 01 Jun 2011 12:28:16 +0000</pubDate>
		<guid isPermaLink="false">http://antognini.ch/?p=393#comment-23452</guid>
		<description>[...] http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/ (הניסוי מוצג בהערה מספר 18 של הפוסט בלינק לעיל.) [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/" rel="nofollow">http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/</a> (הניסוי מוצג בהערה מספר 18 של הפוסט בלינק לעיל.) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: True or False &#8211; Direct Path Reads &#171; Charles Hooper&#39;s Oracle Notes</title>
		<link>http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/comment-page-1/#comment-9158</link>
		<dc:creator>True or False &#8211; Direct Path Reads &#171; Charles Hooper&#39;s Oracle Notes</dc:creator>
		<pubDate>Wed, 21 Apr 2010 06:03:44 +0000</pubDate>
		<guid isPermaLink="false">http://antognini.ch/?p=393#comment-9158</guid>
		<description>[...] http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/ (dated July 23, 2009) [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/ (dated" rel="nofollow">http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/ (dated</a> July 23, 2009) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Antognini</title>
		<link>http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/comment-page-1/#comment-6283</link>
		<dc:creator>Christian Antognini</dc:creator>
		<pubDate>Fri, 11 Dec 2009 06:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://antognini.ch/?p=393#comment-6283</guid>
		<description>Ciao Donatello

&gt; what I meant is that after I insert (ie before the
&gt; select count (*)...) saw a number dirty blocks in SGA

&gt; the image of those blocks does not match that on disk
&gt; also because some blocks there have never been on disk, right?

Yes, a regular insert writes into the buffer cache only.

&gt; when I run &quot;select count (*) from t&quot; and I see that Oracle uses
&gt; &quot;Direct reads&quot; ...
&gt;
&gt; ... this means that Oracle has done in the meantime
&gt; a checkpoint and then brought up the disc, even blocks that
&gt; were in SGA?

Yes. 

And now I understand what bothers you :-) It is effectively so that the DBWR has to write some blocks to disk and just after that the server process has to read them back.

HTH
Chris</description>
		<content:encoded><![CDATA[<p>Ciao Donatello</p>
<p>&gt; what I meant is that after I insert (ie before the<br />
&gt; select count (*)&#8230;) saw a number dirty blocks in SGA</p>
<p>&gt; the image of those blocks does not match that on disk<br />
&gt; also because some blocks there have never been on disk, right?</p>
<p>Yes, a regular insert writes into the buffer cache only.</p>
<p>&gt; when I run &#8220;select count (*) from t&#8221; and I see that Oracle uses<br />
&gt; &#8220;Direct reads&#8221; &#8230;<br />
&gt;<br />
&gt; &#8230; this means that Oracle has done in the meantime<br />
&gt; a checkpoint and then brought up the disc, even blocks that<br />
&gt; were in SGA?</p>
<p>Yes. </p>
<p>And now I understand what bothers you :-) It is effectively so that the DBWR has to write some blocks to disk and just after that the server process has to read them back.</p>
<p>HTH<br />
Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donatello Settembrino</title>
		<link>http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/comment-page-1/#comment-6162</link>
		<dc:creator>Donatello Settembrino</dc:creator>
		<pubDate>Wed, 02 Dec 2009 10:01:20 +0000</pubDate>
		<guid isPermaLink="false">http://antognini.ch/?p=393#comment-6162</guid>
		<description>Ciao Christian,

I have explained myself badly, I understood from what you had written that
a key prerequisite is that a checkpoint has been executed,
but what I meant is that after I insert (ie before the
select count (*)...) saw a number bi dirty blocks in SGA


&lt;pre&gt;

D   COUNT(*)
- ----------
Y      21578
N       1582

&lt;/pre&gt;

and this means that (the image of those blocks does not match that on disk
also because some blocks there have never been on disk, right?).
I&#039;d like to have only confirmed the following concept:

when I run &quot;select count (*) from t&quot; and I see that Oracle uses
&quot;Direct reads&quot; ...

&lt;pre&gt;

NAME                        VALUE
--------------------------- ----------
physical reads                      51
physical reads direct                0

select count(*) from t;

NAME                        VALUE
--------------------------- ----------
physical reads                   50553
physical reads direct            50118

&lt;/pre&gt;


... this means that Oracle has done in the meantime
a checkpoint and then brought up the disc, even blocks that
were in SGA? If not, I would not expect &quot;direct reads&quot;
but &quot;conventional reads.

Thanks</description>
		<content:encoded><![CDATA[<p>Ciao Christian,</p>
<p>I have explained myself badly, I understood from what you had written that<br />
a key prerequisite is that a checkpoint has been executed,<br />
but what I meant is that after I insert (ie before the<br />
select count (*)&#8230;) saw a number bi dirty blocks in SGA</p>
<p><pre>

D   COUNT(*)
- ----------
Y      21578
N       1582

</pre></p>
<p>and this means that (the image of those blocks does not match that on disk<br />
also because some blocks there have never been on disk, right?).<br />
I&#8217;d like to have only confirmed the following concept:</p>
<p>when I run &#8220;select count (*) from t&#8221; and I see that Oracle uses<br />
&#8220;Direct reads&#8221; &#8230;</p>
<p><pre>

NAME                        VALUE
--------------------------- ----------
physical reads                      51
physical reads direct                0

select count(*) from t;

NAME                        VALUE
--------------------------- ----------
physical reads                   50553
physical reads direct            50118

</pre></p>
<p>&#8230; this means that Oracle has done in the meantime<br />
a checkpoint and then brought up the disc, even blocks that<br />
were in SGA? If not, I would not expect &#8220;direct reads&#8221;<br />
but &#8220;conventional reads.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Antognini</title>
		<link>http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/comment-page-1/#comment-6145</link>
		<dc:creator>Christian Antognini</dc:creator>
		<pubDate>Tue, 01 Dec 2009 15:44:24 +0000</pubDate>
		<guid isPermaLink="false">http://antognini.ch/?p=393#comment-6145</guid>
		<description>Ciao Donatello

I&#039;m not sure to fully understand what do you mean... This is probably because you are confused by the dirty blocks in the SGA. The important thing you have to remember is that before doing direct reads a segment checkpoint has to be performed. Because of the segment checkpoint, all blocks are on disk and, therefore, every time that they are read through a direct read a deferred cleanout has to be performed.

HTH
Chris</description>
		<content:encoded><![CDATA[<p>Ciao Donatello</p>
<p>I&#8217;m not sure to fully understand what do you mean&#8230; This is probably because you are confused by the dirty blocks in the SGA. The important thing you have to remember is that before doing direct reads a segment checkpoint has to be performed. Because of the segment checkpoint, all blocks are on disk and, therefore, every time that they are read through a direct read a deferred cleanout has to be performed.</p>
<p>HTH<br />
Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donatello Settembrino</title>
		<link>http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/comment-page-1/#comment-6129</link>
		<dc:creator>Donatello Settembrino</dc:creator>
		<pubDate>Mon, 30 Nov 2009 15:15:02 +0000</pubDate>
		<guid isPermaLink="false">http://antognini.ch/?p=393#comment-6129</guid>
		<description>Ciao Christian,
I would like to ask you one last question , this time as
regards direct reads and delayed block cleanout, in 10g:

&lt;pre&gt;

dsettembrino&gt;alter session set &quot;_serial_direct_read&quot; = true;

dsettembrino&gt;create table t (x char(1000), y char(1000), z char(1000));

dsettembrino&gt;insert into t select &#039;x&#039;, &#039;y&#039;, &#039;z&#039; from dual connect by level &lt;= 200000;

dsettembrino&gt;commit;

&lt;/pre&gt;

I check if there are dirty blocks, as lawful expect:


&lt;pre&gt;

dsettembrino&gt;select v.dirty, count(*)
  2  from v$bh v
  3  where v.objd = (select object_id from user_objects where object_name = &#039;T&#039;)
  4  group by v.dirty;

D   COUNT(*)
- ----------
Y      21578
N       1582

&lt;/pre&gt;

This means that there are dirty blocks in buffer cache, insert&#039;s blocks are 
by definition. I run some statistical checks before executing my query:


&lt;pre&gt;
dsettembrino&gt;select n.name, m.value
  2  from  v$mystat m, v$statname n
  3  where m.STATISTIC# = n.STATISTIC#
  4  and   n.name in (&#039;redo size&#039;, &#039;cleanouts only - consistent read gets&#039; 
  5                    , &#039;direct path read&#039;, &#039;consistent gets&#039;
  6                    , &#039;physical reads&#039;, &#039;physical reads&#039;
  7                    ,&#039;physical reads direct&#039;, &#039;undo change vector size&#039;);

NAME                                                                  VALUE
---------------------------------------------------------------- ----------
consistent gets                                                       92975
physical reads                                                           51
physical reads direct                                                     0
redo size                                                         634580860
undo change vector size                                             5829132
cleanouts only - consistent read gets                                     0

&lt;/pre&gt;

I run my query:


&lt;pre&gt;
dsettembrino&gt;select count(*) from t;

  COUNT(*)
----------
    200000

&lt;/pre&gt;

So,I rerun the statistics:

&lt;pre&gt;
dsettembrino&gt;select n.name, m.value
  2  from  v$mystat m, v$statname n
  3  where m.STATISTIC# = n.STATISTIC#
  4  and   n.name in (&#039;redo size&#039;, &#039;cleanouts only - consistent read gets&#039; 
  5                   , &#039;direct path read&#039;, &#039;consistent gets&#039;
  6                   , &#039;physical reads&#039;, &#039;physical reads&#039;
  7                   ,&#039;physical reads direct&#039;, &#039;undo change vector size&#039;);

NAME                                                                  VALUE
---------------------------------------------------------------- ----------
consistent gets                                                      183930
physical reads                                                        50553
physical reads direct                                                 50118
redo size                                                         634586868
undo change vector size                                             5829132
cleanouts only - consistent read gets                                 40506

&lt;/pre&gt;

My interpretation is the following:

When I run my query (the select count (*) from t;) there are
blocks in buffer cache. I see from the statistic that Oracle 
has solved my query using direct reads. To do that, Oracle 
must make changes to blocks, to download it from SGA and then 
bring these blocks into PGA, since the engine Oracle has 
established that the circumstances require the use of direct reads.

1)Is it correct what I say? 

2)If my hypothesis is correct, it means that during the query
  (select count (*) from t) were performed delayed block cleanout
  for a number of blocks (the ones on disk) + fast commit to a number
  blocks (those who were SGA) before the engine execute direct reads? 

Kind  Regards,
Donatello</description>
		<content:encoded><![CDATA[<p>Ciao Christian,<br />
I would like to ask you one last question , this time as<br />
regards direct reads and delayed block cleanout, in 10g:</p>
<p><pre>

dsettembrino&gt;alter session set &quot;_serial_direct_read&quot; = true;

dsettembrino&gt;create table t (x char(1000), y char(1000), z char(1000));

dsettembrino&gt;insert into t select &#039;x&#039;, &#039;y&#039;, &#039;z&#039; from dual connect by level &lt;= 200000;

dsettembrino&gt;commit;

</pre></p>
<p>I check if there are dirty blocks, as lawful expect:</p>
<p><pre>

dsettembrino&gt;select v.dirty, count(*)
  2  from v$bh v
  3  where v.objd = (select object_id from user_objects where object_name = &#039;T&#039;)
  4  group by v.dirty;

D   COUNT(*)
- ----------
Y      21578
N       1582

</pre></p>
<p>This means that there are dirty blocks in buffer cache, insert&#8217;s blocks are<br />
by definition. I run some statistical checks before executing my query:</p>
<p><pre>
dsettembrino&gt;select n.name, m.value
  2  from  v$mystat m, v$statname n
  3  where m.STATISTIC# = n.STATISTIC#
  4  and   n.name in (&#039;redo size&#039;, &#039;cleanouts only - consistent read gets&#039; 
  5                    , &#039;direct path read&#039;, &#039;consistent gets&#039;
  6                    , &#039;physical reads&#039;, &#039;physical reads&#039;
  7                    ,&#039;physical reads direct&#039;, &#039;undo change vector size&#039;);

NAME                                                                  VALUE
---------------------------------------------------------------- ----------
consistent gets                                                       92975
physical reads                                                           51
physical reads direct                                                     0
redo size                                                         634580860
undo change vector size                                             5829132
cleanouts only - consistent read gets                                     0

</pre></p>
<p>I run my query:</p>
<p><pre>
dsettembrino&gt;select count(*) from t;

  COUNT(*)
----------
    200000

</pre></p>
<p>So,I rerun the statistics:</p>
<p><pre>
dsettembrino&gt;select n.name, m.value
  2  from  v$mystat m, v$statname n
  3  where m.STATISTIC# = n.STATISTIC#
  4  and   n.name in (&#039;redo size&#039;, &#039;cleanouts only - consistent read gets&#039; 
  5                   , &#039;direct path read&#039;, &#039;consistent gets&#039;
  6                   , &#039;physical reads&#039;, &#039;physical reads&#039;
  7                   ,&#039;physical reads direct&#039;, &#039;undo change vector size&#039;);

NAME                                                                  VALUE
---------------------------------------------------------------- ----------
consistent gets                                                      183930
physical reads                                                        50553
physical reads direct                                                 50118
redo size                                                         634586868
undo change vector size                                             5829132
cleanouts only - consistent read gets                                 40506

</pre></p>
<p>My interpretation is the following:</p>
<p>When I run my query (the select count (*) from t;) there are<br />
blocks in buffer cache. I see from the statistic that Oracle<br />
has solved my query using direct reads. To do that, Oracle<br />
must make changes to blocks, to download it from SGA and then<br />
bring these blocks into PGA, since the engine Oracle has<br />
established that the circumstances require the use of direct reads.</p>
<p>1)Is it correct what I say? </p>
<p>2)If my hypothesis is correct, it means that during the query<br />
  (select count (*) from t) were performed delayed block cleanout<br />
  for a number of blocks (the ones on disk) + fast commit to a number<br />
  blocks (those who were SGA) before the engine execute direct reads? </p>
<p>Kind  Regards,<br />
Donatello</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Antognini</title>
		<link>http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/comment-page-1/#comment-6117</link>
		<dc:creator>Christian Antognini</dc:creator>
		<pubDate>Sun, 29 Nov 2009 13:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://antognini.ch/?p=393#comment-6117</guid>
		<description>Ciao Donatello

Yes, your interpretation is correct. Just note that the initialization _serial_direct_read exists from a long time (8i?) and, probably for that reason, it is not (directly) related to the serial direct reads that are used in recent releases.

Cheers,
Chris</description>
		<content:encoded><![CDATA[<p>Ciao Donatello</p>
<p>Yes, your interpretation is correct. Just note that the initialization _serial_direct_read exists from a long time (8i?) and, probably for that reason, it is not (directly) related to the serial direct reads that are used in recent releases.</p>
<p>Cheers,<br />
Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donatello Settembrino</title>
		<link>http://antognini.ch/2009/07/impact-of-direct-reads-on-delayed-block-cleanouts/comment-page-1/#comment-6068</link>
		<dc:creator>Donatello Settembrino</dc:creator>
		<pubDate>Thu, 26 Nov 2009 10:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://antognini.ch/?p=393#comment-6068</guid>
		<description>Hi Christian, I read your interesting test and this connection, I bring 
to your attention some doubts on manage of direct reads.

I did two tests, the first on DB version 10g, the other in 11g to try to 
understand if the principle is the same for the two versions DB. I know 
that a condition for Oracle decides to perform direct reads is that the 
number of blocks should be about 5 times the value of hidden parameter
_small_table_threshold.


test 10g

&lt;pre&gt;

SQL&gt; select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
NLSRTL Version 10.2.0.4.0 - Production


NAME                     VALUE      DEFLT      TYPE         DESCRIPTION                      
------------------------ ---------- ------------------------------------------------------------
_serial_direct_read      FALSE      TRUE       boolean      enable direct read in serial


SQL&gt; select ksppstvl small_tab_threshold, ksppstvl * 5 as block_for_direct_reads
  2  from sys.x_$ksppi x, sys.x_$ksppsv y
  3  where (x.indx = y.indx)
  4  and ksppinm=&#039;_small_table_threshold&#039;;

SMALL_TAB_THRESHOLD   BLOCK_FOR_DIRECT_READS
--------------------  ----------------------
2130                                  10650

&lt;/pre&gt;

so with a number of blocks greater than 10650, the direct reads should be used

&lt;pre&gt;
SQL&gt; create table t (x char(1000), y char(1000), z char(1000));

SQL&gt; insert into t select &#039;x&#039;, &#039;y&#039;, &#039;z&#039; from dual connect by level &lt;= 200000;

SQL&gt; commit;

SQL&gt; alter system flush buffer_cache;


NAME                                          VALUE
---------------------------------------- ----------
physical reads                                  178
physical reads direct                             0

SQL&gt; select count(*) from t;

  COUNT(*)
----------
    200000



NAME                             VALUE
--------------------------- ----------
physical reads                   50626
physical reads direct                0

&lt;/pre&gt;


but this doesn&#039;t happen. For completeness, I also see the number of blocks of the table


&lt;pre&gt;
SQL&gt; select num_rows, blocks from user_tables where table_name = &#039;T&#039;;

  NUM_ROWS     BLOCKS
---------- ----------
    200000      50437
&lt;/pre&gt;



I run the same test at 11g:

&lt;pre&gt;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
CORE    11.1.0.6.0      Production
TNS for IBM/AIX RISC System/6000: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production



NAME                     VALUE      DEFLT      TYPE         DESCRIPTION                      
------------------------ ---------- ------------------------------------------------------------
_serial_direct_read      FALSE      TRUE       boolean      enable direct read in serial      



SMALL_TAB_THRESHOLD   BLOCK_FOR_DIRECT_READS
--------------------  ----------------------
1424                                    7120

&lt;/pre&gt;


So, I have the same situation that I had in 10g, but with a different value _small_table_threshold



&lt;pre&gt;

SQL&gt; create table t (x char(1000), y char(1000), z char(1000));

SQL&gt; insert into t select &#039;x&#039;, &#039;y&#039;, &#039;z&#039; from dual connect by level &lt;= 200000;

SQL&gt; commit;

SQL&gt; alter system flush buffer_cache;

NAME                          VALUE
------------------------ ----------
physical reads                  156
physical reads direct             0



SQL&gt; select count(*) from t;

  COUNT(*)
----------
    200000


NAME                                VALUE
------------------------------ ----------
physical reads                      50754
physical reads direct               50183

&lt;/pre&gt;


I noticed that in 11g, on equal terms with the test conducted in the version
10g, then with _serial_direct_read -&gt; FALSE and the number of blocks (50437) exceeds 5
times the value of _small_table_threshold (7120) the direct reads are applied
as not done in 10g


&lt;pre&gt;

SQL&gt; select num_rows, blocks from dba_tables where TABLE_NAME = &#039;T&#039;;

  NUM_ROWS     BLOCKS
---------- ----------
    200000      50437

&lt;/pre&gt;

But then this means that even if Oracle version 11g
_serial_direct_read = FALSE (but the number of blocks is greater than 5 times the value
_small_table_threshold most of the other conditions to which I referred you)
the direct reads are performed?

Is my interpretation  correct?

Thanks a lot

Donatello</description>
		<content:encoded><![CDATA[<p>Hi Christian, I read your interesting test and this connection, I bring<br />
to your attention some doubts on manage of direct reads.</p>
<p>I did two tests, the first on DB version 10g, the other in 11g to try to<br />
understand if the principle is the same for the two versions DB. I know<br />
that a condition for Oracle decides to perform direct reads is that the<br />
number of blocks should be about 5 times the value of hidden parameter<br />
_small_table_threshold.</p>
<p>test 10g</p>
<p><pre>

SQL&gt; select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
NLSRTL Version 10.2.0.4.0 - Production

NAME                     VALUE      DEFLT      TYPE         DESCRIPTION                      
------------------------ ---------- ------------------------------------------------------------
_serial_direct_read      FALSE      TRUE       boolean      enable direct read in serial

SQL&gt; select ksppstvl small_tab_threshold, ksppstvl * 5 as block_for_direct_reads
  2  from sys.x_$ksppi x, sys.x_$ksppsv y
  3  where (x.indx = y.indx)
  4  and ksppinm=&#039;_small_table_threshold&#039;;

SMALL_TAB_THRESHOLD   BLOCK_FOR_DIRECT_READS
--------------------  ----------------------
2130                                  10650

</pre></p>
<p>so with a number of blocks greater than 10650, the direct reads should be used</p>
<p><pre>
SQL&gt; create table t (x char(1000), y char(1000), z char(1000));

SQL&gt; insert into t select &#039;x&#039;, &#039;y&#039;, &#039;z&#039; from dual connect by level &lt;= 200000;

SQL&gt; commit;

SQL&gt; alter system flush buffer_cache;

NAME                                          VALUE
---------------------------------------- ----------
physical reads                                  178
physical reads direct                             0

SQL&gt; select count(*) from t;

  COUNT(*)
----------
    200000

NAME                             VALUE
--------------------------- ----------
physical reads                   50626
physical reads direct                0

</pre></p>
<p>but this doesn&#8217;t happen. For completeness, I also see the number of blocks of the table</p>
<p><pre>
SQL&gt; select num_rows, blocks from user_tables where table_name = &#039;T&#039;;

  NUM_ROWS     BLOCKS
---------- ----------
    200000      50437
</pre></p>
<p>I run the same test at 11g:</p>
<p><pre>

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
CORE    11.1.0.6.0      Production
TNS for IBM/AIX RISC System/6000: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production

NAME                     VALUE      DEFLT      TYPE         DESCRIPTION                      
------------------------ ---------- ------------------------------------------------------------
_serial_direct_read      FALSE      TRUE       boolean      enable direct read in serial      

SMALL_TAB_THRESHOLD   BLOCK_FOR_DIRECT_READS
--------------------  ----------------------
1424                                    7120

</pre></p>
<p>So, I have the same situation that I had in 10g, but with a different value _small_table_threshold</p>
<p><pre>

SQL&gt; create table t (x char(1000), y char(1000), z char(1000));

SQL&gt; insert into t select &#039;x&#039;, &#039;y&#039;, &#039;z&#039; from dual connect by level &lt;= 200000;

SQL&gt; commit;

SQL&gt; alter system flush buffer_cache;

NAME                          VALUE
------------------------ ----------
physical reads                  156
physical reads direct             0

SQL&gt; select count(*) from t;

  COUNT(*)
----------
    200000

NAME                                VALUE
------------------------------ ----------
physical reads                      50754
physical reads direct               50183

</pre></p>
<p>I noticed that in 11g, on equal terms with the test conducted in the version<br />
10g, then with _serial_direct_read -&gt; FALSE and the number of blocks (50437) exceeds 5<br />
times the value of _small_table_threshold (7120) the direct reads are applied<br />
as not done in 10g</p>
<p><pre>

SQL&gt; select num_rows, blocks from dba_tables where TABLE_NAME = &#039;T&#039;;

  NUM_ROWS     BLOCKS
---------- ----------
    200000      50437

</pre></p>
<p>But then this means that even if Oracle version 11g<br />
_serial_direct_read = FALSE (but the number of blocks is greater than 5 times the value<br />
_small_table_threshold most of the other conditions to which I referred you)<br />
the direct reads are performed?</p>
<p>Is my interpretation  correct?</p>
<p>Thanks a lot</p>
<p>Donatello</p>
]]></content:encoded>
	</item>
</channel>
</rss>

