<?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: Tuning Updates</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/</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: Index Full Scan and array of changes in DML &#171; Alexander Anokhin</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-43699</link>
		<dc:creator><![CDATA[Index Full Scan and array of changes in DML &#171; Alexander Anokhin]]></dc:creator>
		<pubDate>Wed, 28 Dec 2011 14:36:17 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-43699</guid>
		<description><![CDATA[[...] 1. I&#8217;ve learnt that Jonathan Lewis wrote about this phenomenon in 2006(!) http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/ [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 1. I&#8217;ve learnt that Jonathan Lewis wrote about this phenomenon in 2006(!) <a href="http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/" rel="nofollow">http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: More CR &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-40370</link>
		<dc:creator><![CDATA[More CR &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Tue, 19 Apr 2011 18:35:22 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-40370</guid>
		<description><![CDATA[[...] pointed out before now that choosing a different execution plan for an update can have a big impact on performance &#8211; this is just another example demonstrating the [...]]]></description>
		<content:encoded><![CDATA[<p>[...] pointed out before now that choosing a different execution plan for an update can have a big impact on performance &#8211; this is just another example demonstrating the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-36004</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 12 Apr 2010 13:53:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-36004</guid>
		<description><![CDATA[Dilip,
There&#039;s not enough information there to comment. But I note you&#039;ve changed from 8KB blocks to 16KB blocks and you&#039;re doing an update. If that update is causing a lot of row migration and you&#039;re using ASSM you might be seeing an example of at &lt;a href=&quot;http://jonathanlewis.wordpress.com/2009/09/25/bugs/&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;&lt;strong&gt;this bug&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt;.

In passing - if you&#039;re trying to track down a problem, then it&#039;s best to start tailoring your queries to give yourself the information you need to see.  For example, it makes things harder to grasp if you report &quot;AVG_BUFFER_MB&quot; when (a) you&#039;re looking at one query, and (b) you&#039;re interested in the number of buffer visits.]]></description>
		<content:encoded><![CDATA[<p>Dilip,<br />
There&#8217;s not enough information there to comment. But I note you&#8217;ve changed from 8KB blocks to 16KB blocks and you&#8217;re doing an update. If that update is causing a lot of row migration and you&#8217;re using ASSM you might be seeing an example of at <a href="http://jonathanlewis.wordpress.com/2009/09/25/bugs/" rel="nofollow"><em><strong>this bug</strong></em></a>.</p>
<p>In passing &#8211; if you&#8217;re trying to track down a problem, then it&#8217;s best to start tailoring your queries to give yourself the information you need to see.  For example, it makes things harder to grasp if you report &#8220;AVG_BUFFER_MB&#8221; when (a) you&#8217;re looking at one query, and (b) you&#8217;re interested in the number of buffer visits.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dilip Patel</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-35987</link>
		<dc:creator><![CDATA[Dilip Patel]]></dc:creator>
		<pubDate>Wed, 07 Apr 2010 12:32:09 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-35987</guid>
		<description><![CDATA[Hi Jonathan,

I have tested update on similer test tables in 9i and 10g. Buffer gets was alarmingly high on 11g compared to 10g.

Here is my test.

Oracle 10g. (8K Block size, buffer cached flushed before test executed, no other operation running while this testing).
[sourcecode]
SQL&gt; update pateld.table_on_network_storage set segmentation=&#039;TEST&#039;;

1119998 rows updated.

Elapsed: 00:01:58.25

system@WFLDEV&gt; SELECT
  2  executions,
  3 disk_reads*8/1024/executions                avg_disk_read_MB,
  4  buffer_gets*8/1024/executions                   avg_buffer_MB,
  5  direct_writes*8/1024                                      avg_write_MB,
  6  (disk_reads*8/1024 +direct_writes*8/1024)/ (elapsed_time/1000000) /executions AVG_IO_MB_SECOND,
  7  (elapsed_time/1000000)/executions                         avg_elapsed,
  8  cpu_time/1000000/executions                                      avg_cpu
  9  FROM
 10   v$sql a
 11  WHERE
 12              sql_id= &#039;01s561a8yytpu&#039;;

EXECUTIONS AVG_DISK_READ_MB AVG_BUFFER_MB AVG_WRITE_MB AVG_IO_MB_SECOND AVG_ELAPSED    AVG_CPU
---------- ---------------- ------------- ------------ ---------------- ----------- ----------
         1       1003.35156    10021.0234            0       8.69134954  115.442551       77.5

[/sourcecode]
Here I can see 10021 MB Buffer gets.

Oracle 11g: (Block size 16K, Buffer cache flushed before running this query, no other job/sql running while this test)
[sourcecode]
SQL&gt; update pateld.table_on_network_storage set segmentation=&#039;TEST&#039;;

1119998 rows updated.

Elapsed: 00:05:24.88

system@DWODSU01&gt; SELECT
  2  executions,
  3  disk_reads*16/1024/executions                avg_disk_read_MB,
  4  buffer_gets*16/1024/executions               avg_buffer_MB,
  5  direct_writes*16/1024                             avg_write_MB,
  6  (disk_reads*16/1024 +direct_writes*16/1024)/ (elapsed_time/1000000) /executions AVG_IO_MB_SECOND,
  7  (elapsed_time/1000000)/executions                 avg_elapsed,
  8  cpu_time/1000000/executions                        avg_cpu
  9  FROM
 10   v$sql a
 11  WHERE
 12              sql_id= &#039;b8qv4rxv2c30d&#039;;

EXECUTIONS AVG_DISK_READ_MB AVG_BUFFER_MB AVG_WRITE_MB AVG_IO_MB_SECOND AVG_ELAPSED    AVG_CPU
---------- ---------------- ------------- ------------ ---------------- ----------- ----------
         1          1997.25    39049.8125            0       6.29627302  317.211467     105.21

system@DWODSU01&gt;
[/sourcecode]
I can see very high 39049 MB buffer gets. Execution time also 5 times more compared to 10g database.

Both 10g and 11g servers are similer CPU and memory (also SGA) confuguration.

Thx

Dilip Patel.]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>I have tested update on similer test tables in 9i and 10g. Buffer gets was alarmingly high on 11g compared to 10g.</p>
<p>Here is my test.</p>
<p>Oracle 10g. (8K Block size, buffer cached flushed before test executed, no other operation running while this testing).</p>
<pre class="brush: plain; title: ; notranslate">
SQL&gt; update pateld.table_on_network_storage set segmentation='TEST';

1119998 rows updated.

Elapsed: 00:01:58.25

system@WFLDEV&gt; SELECT
  2  executions,
  3 disk_reads*8/1024/executions                avg_disk_read_MB,
  4  buffer_gets*8/1024/executions                   avg_buffer_MB,
  5  direct_writes*8/1024                                      avg_write_MB,
  6  (disk_reads*8/1024 +direct_writes*8/1024)/ (elapsed_time/1000000) /executions AVG_IO_MB_SECOND,
  7  (elapsed_time/1000000)/executions                         avg_elapsed,
  8  cpu_time/1000000/executions                                      avg_cpu
  9  FROM
 10   v$sql a
 11  WHERE
 12              sql_id= '01s561a8yytpu';

EXECUTIONS AVG_DISK_READ_MB AVG_BUFFER_MB AVG_WRITE_MB AVG_IO_MB_SECOND AVG_ELAPSED    AVG_CPU
---------- ---------------- ------------- ------------ ---------------- ----------- ----------
         1       1003.35156    10021.0234            0       8.69134954  115.442551       77.5

</pre>
<p>Here I can see 10021 MB Buffer gets.</p>
<p>Oracle 11g: (Block size 16K, Buffer cache flushed before running this query, no other job/sql running while this test)</p>
<pre class="brush: plain; title: ; notranslate">
SQL&gt; update pateld.table_on_network_storage set segmentation='TEST';

1119998 rows updated.

Elapsed: 00:05:24.88

system@DWODSU01&gt; SELECT
  2  executions,
  3  disk_reads*16/1024/executions                avg_disk_read_MB,
  4  buffer_gets*16/1024/executions               avg_buffer_MB,
  5  direct_writes*16/1024                             avg_write_MB,
  6  (disk_reads*16/1024 +direct_writes*16/1024)/ (elapsed_time/1000000) /executions AVG_IO_MB_SECOND,
  7  (elapsed_time/1000000)/executions                 avg_elapsed,
  8  cpu_time/1000000/executions                        avg_cpu
  9  FROM
 10   v$sql a
 11  WHERE
 12              sql_id= 'b8qv4rxv2c30d';

EXECUTIONS AVG_DISK_READ_MB AVG_BUFFER_MB AVG_WRITE_MB AVG_IO_MB_SECOND AVG_ELAPSED    AVG_CPU
---------- ---------------- ------------- ------------ ---------------- ----------- ----------
         1          1997.25    39049.8125            0       6.29627302  317.211467     105.21

system@DWODSU01&gt;
</pre>
<p>I can see very high 39049 MB buffer gets. Execution time also 5 times more compared to 10g database.</p>
<p>Both 10g and 11g servers are similer CPU and memory (also SGA) confuguration.</p>
<p>Thx</p>
<p>Dilip Patel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-32750</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 23 Mar 2009 17:18:53 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-32750</guid>
		<description><![CDATA[Chris,

I think there are several questions we could ask before coming up with the best solution. For example - since you&#039;re updating every row would you be allowed to do something like:
&lt;code&gt;
create new_table nologging as
select newvalue1, newvalue2, {rest of columns} from old table;
create new_indexes
rename old_table ...
rename new_table ...
rename new_indexes
drop old table
&lt;/code&gt;

If you can&#039;t play games with dropping and recreating, have you tried something like:
&lt;code&gt;
update /*+ index(pk index) */ table set ... where pk is not null;
&lt;/code&gt;

Could you do an update in parallel ?
Can you disable and recreate (nologging) any indexes that would otherwise be affected by the update ?]]></description>
		<content:encoded><![CDATA[<p>Chris,</p>
<p>I think there are several questions we could ask before coming up with the best solution. For example &#8211; since you&#8217;re updating every row would you be allowed to do something like:<br />
<code><br />
create new_table nologging as<br />
select newvalue1, newvalue2, {rest of columns} from old table;<br />
create new_indexes<br />
rename old_table ...<br />
rename new_table ...<br />
rename new_indexes<br />
drop old table<br />
</code></p>
<p>If you can&#8217;t play games with dropping and recreating, have you tried something like:<br />
<code><br />
update /*+ index(pk index) */ table set ... where pk is not null;<br />
</code></p>
<p>Could you do an update in parallel ?<br />
Can you disable and recreate (nologging) any indexes that would otherwise be affected by the update ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris C.</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-32748</link>
		<dc:creator><![CDATA[Chris C.]]></dc:creator>
		<pubDate>Mon, 23 Mar 2009 15:22:22 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-32748</guid>
		<description><![CDATA[Can you suggest something for an update statement without a where clause.  Since I need to update all rows in the table, how can I get better performance?

UPDATE test_table
SET    col1 = newvalue1,
       col2 = newvalue2;

Any help is appreciated.

Chris]]></description>
		<content:encoded><![CDATA[<p>Can you suggest something for an update statement without a where clause.  Since I need to update all rows in the table, how can I get better performance?</p>
<p>UPDATE test_table<br />
SET    col1 = newvalue1,<br />
       col2 = newvalue2;</p>
<p>Any help is appreciated.</p>
<p>Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-32490</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 03 Jan 2009 09:18:41 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-32490</guid>
		<description><![CDATA[CT,
You never told us if you had followed my suggestions for a test - but the answer to your original question is yes.  

I did a quick test just before supplying the suggestions &lt;em&gt;&lt;strong&gt;&lt;a href=&quot;http://forums.oracle.com/forums/message.jspa?messageID=3197016#3197016&quot; rel=&quot;nofollow&quot;&gt;in this thread of the Oracle Forum:&lt;/a&gt;&lt;/strong&gt;&lt;/em&gt;

The results seemed to have been &lt;em&gt;&lt;strong&gt;&lt;a href=&quot;http://forums.oracle.com/forums/message.jspa?messageID=3197065#3197065&quot; rel=&quot;nofollow&quot;&gt;quite beneficial&lt;/a&gt;&lt;/strong&gt;&lt;/em&gt;

&lt;strong&gt;Update:&lt;/strong&gt; This thread has since been removed from OTN thanks to the comments made by one of the posters - unfortunately I don&#039;t have a backup, but the point was that the strategy works for deletes, not just updates.

]]></description>
		<content:encoded><![CDATA[<p>CT,<br />
You never told us if you had followed my suggestions for a test &#8211; but the answer to your original question is yes.  </p>
<p>I did a quick test just before supplying the suggestions <em><strong><a href="http://forums.oracle.com/forums/message.jspa?messageID=3197016#3197016" rel="nofollow">in this thread of the Oracle Forum:</a></strong></em></p>
<p>The results seemed to have been <em><strong><a href="http://forums.oracle.com/forums/message.jspa?messageID=3197065#3197065" rel="nofollow">quite beneficial</a></strong></em></p>
<p><strong>Update:</strong> This thread has since been removed from OTN thanks to the comments made by one of the posters &#8211; unfortunately I don&#8217;t have a backup, but the point was that the strategy works for deletes, not just updates.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-32095</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Fri, 17 Oct 2008 21:42:07 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-32095</guid>
		<description><![CDATA[A recent question on OTN prompted me to check what would happen if the indexes that needed to be updated were bitmap indexes (and the driving index was still a b-tree). 

The answer was that in both cases delayed index maintenance took place. The index entries were sorted and updated after the table update was complete - whether the driving access path was a tablescan or index.]]></description>
		<content:encoded><![CDATA[<p>A recent question on OTN prompted me to check what would happen if the indexes that needed to be updated were bitmap indexes (and the driving index was still a b-tree). </p>
<p>The answer was that in both cases delayed index maintenance took place. The index entries were sorted and updated after the table update was complete &#8211; whether the driving access path was a tablescan or index.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-2340</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 25 Jan 2007 00:13:22 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-2340</guid>
		<description><![CDATA[CT - if you are curious, build a test case and try it. Write a script to create a table with a lot of data and delete with a full() hint, then repeat with an index() hint.  Check the execution plan to make sure you&#039;ve got the hint working.  Disconnect and reconnect before the delete, and check v$mystat after the delete.]]></description>
		<content:encoded><![CDATA[<p>CT &#8211; if you are curious, build a test case and try it. Write a script to create a table with a lot of data and delete with a full() hint, then repeat with an index() hint.  Check the execution plan to make sure you&#8217;ve got the hint working.  Disconnect and reconnect before the delete, and check v$mystat after the delete.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CT</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-2290</link>
		<dc:creator><![CDATA[CT]]></dc:creator>
		<pubDate>Wed, 24 Jan 2007 14:27:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/#comment-2290</guid>
		<description><![CDATA[Hello Mr.Lewis

Is this true when we do a delete. I have a batch program which does an average of two million rows every day but it does thru index scan, so I am not worried. But I am curious.

Thanks
CT]]></description>
		<content:encoded><![CDATA[<p>Hello Mr.Lewis</p>
<p>Is this true when we do a delete. I have a batch program which does an average of two million rows every day but it does thru index scan, so I am not worried. But I am curious.</p>
<p>Thanks<br />
CT</p>
]]></content:encoded>
	</item>
</channel>
</rss>
