<?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: Superfluous Updates ?</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Wed, 22 May 2013 12:40:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Nathan</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/#comment-15567</link>
		<dc:creator><![CDATA[Nathan]]></dc:creator>
		<pubDate>Tue, 17 Jul 2007 23:08:36 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=108#comment-15567</guid>
		<description><![CDATA[This is obviously an old post, but thought I would enter my 2 cents...

There are some very specific cases where &quot;only updating modified rows&quot; is very valuable, but I agree that (in general) it is not advisable. 
Currently the only method to guarantee that a large update (think 60 columns) only updates rows where values change is to compare all of the columns in the &quot;WHERE&quot; clause. Developers have to do this themselves, which gets nasty with a large number of columns. I can&#039;t help but think that if this were built into the kernal (and added as an optional keyword or hint, similar to how the APPEND() hint significantly alters how Oracle performs its work), that Oracle would probably be able to do this somewhat more efficiently internally (and would save developers the hassle of manually checking every column)...

While on the subject of annoying Oracle things - when Oracle is rolling back data, why does it not provide any way to either TRUNCATE or DROP the affected object and abort the rollback? Oracle can obviously detect which objects are affected (based on the locks), so why not let the affected objects be dropped and save the database resources for something useful?]]></description>
		<content:encoded><![CDATA[<p>This is obviously an old post, but thought I would enter my 2 cents&#8230;</p>
<p>There are some very specific cases where &#8220;only updating modified rows&#8221; is very valuable, but I agree that (in general) it is not advisable.<br />
Currently the only method to guarantee that a large update (think 60 columns) only updates rows where values change is to compare all of the columns in the &#8220;WHERE&#8221; clause. Developers have to do this themselves, which gets nasty with a large number of columns. I can&#8217;t help but think that if this were built into the kernal (and added as an optional keyword or hint, similar to how the APPEND() hint significantly alters how Oracle performs its work), that Oracle would probably be able to do this somewhat more efficiently internally (and would save developers the hassle of manually checking every column)&#8230;</p>
<p>While on the subject of annoying Oracle things &#8211; when Oracle is rolling back data, why does it not provide any way to either TRUNCATE or DROP the affected object and abort the rollback? Oracle can obviously detect which objects are affected (based on the locks), so why not let the affected objects be dropped and save the database resources for something useful?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antonio</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/#comment-3955</link>
		<dc:creator><![CDATA[Antonio]]></dc:creator>
		<pubDate>Tue, 13 Mar 2007 11:33:16 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=108#comment-3955</guid>
		<description><![CDATA[@Wirasat J. Paracha

Because, sometimes, &quot;divede et impera&quot; is a good idea. :)]]></description>
		<content:encoded><![CDATA[<p>@Wirasat J. Paracha</p>
<p>Because, sometimes, &#8220;divede et impera&#8221; is a good idea. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wirasat J. Paracha</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/#comment-3953</link>
		<dc:creator><![CDATA[Wirasat J. Paracha]]></dc:creator>
		<pubDate>Tue, 13 Mar 2007 07:59:31 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=108#comment-3953</guid>
		<description><![CDATA[Why use many not-so-powerful processors working in parallel? Why not just design a single, really powerful processor?]]></description>
		<content:encoded><![CDATA[<p>Why use many not-so-powerful processors working in parallel? Why not just design a single, really powerful processor?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bind Variables &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/#comment-1154</link>
		<dc:creator><![CDATA[Bind Variables &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Fri, 05 Jan 2007 22:17:45 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=108#comment-1154</guid>
		<description><![CDATA[[...] variables and some of the peripheral details that can introduce surprises; and in the article on superfluous updates I made a throwaway comment about getting multiple child cursors for a single statement if you had [...]]]></description>
		<content:encoded><![CDATA[<p>[...] variables and some of the peripheral details that can introduce surprises; and in the article on superfluous updates I made a throwaway comment about getting multiple child cursors for a single statement if you had [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/#comment-1114</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 04 Jan 2007 23:02:20 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=108#comment-1114</guid>
		<description><![CDATA[Robert, that&#039;s a valid point - and once upon a time (ca. 5.1/6.0) there were noises coming out of Oracle about &lt;em&gt;&quot;column level locking&quot;&lt;/em&gt; - i.e. you could update one column in a row whilst I was updating another column in the same row.  Nothing ever came of it but if they had developed the theme then your comments would be more than just theoretically correct.

In fact my statement was concerned more about what currently happens and how I wouldn&#039;t want it to change.  That, of course, introduces the old argument - how much of our code works because of side effects of the current implementation rather than the specified effects.  (Shades of the &lt;em&gt;&quot;group by&quot;/&quot;order by&quot;&lt;/em&gt; argument - except the manuals were always pretty strong on warning that &lt;em&gt;&quot;group by&quot;&lt;/em&gt; does not imply &quot;order by&quot;.)]]></description>
		<content:encoded><![CDATA[<p>Robert, that&#8217;s a valid point &#8211; and once upon a time (ca. 5.1/6.0) there were noises coming out of Oracle about <em>&#8220;column level locking&#8221;</em> &#8211; i.e. you could update one column in a row whilst I was updating another column in the same row.  Nothing ever came of it but if they had developed the theme then your comments would be more than just theoretically correct.</p>
<p>In fact my statement was concerned more about what currently happens and how I wouldn&#8217;t want it to change.  That, of course, introduces the old argument &#8211; how much of our code works because of side effects of the current implementation rather than the specified effects.  (Shades of the <em>&#8220;group by&#8221;/&#8221;order by&#8221;</em> argument &#8211; except the manuals were always pretty strong on warning that <em>&#8220;group by&#8221;</em> does not imply &#8220;order by&#8221;.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert V</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/#comment-1113</link>
		<dc:creator><![CDATA[Robert V]]></dc:creator>
		<pubDate>Thu, 04 Jan 2007 22:40:16 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=108#comment-1113</guid>
		<description><![CDATA[Please consider this off-topic comment in response to a single, isolated statement of yours (ie. not in any way a response to your overall point).  This one:

&quot;If I update a row in a way that changes none of the columns I have still managed to lock the row and no-one else can modify it.  If Oracle bypasses my update simply because it appears to be redundant then it may be subverting my intentions by leaving rows modifiable by other sessions when I want them locked.&quot;

Wait a minute.  You think that an update statement should GUARANTEE a certain row gets locked?

Update means update.  It doesn&#039;t mean lock.  Locking is a means to an end.

Oracle promises you that the data integrity and consistency will be maintained while you do an update.  It does not promise you that it will lock the rows.  Locking the rows is simply the method in which they fulfill that data consistency promise.

When you say &quot;I want to update these rows&quot; I don&#039;t think Oracle should imply &quot;I want you to lock these rows.&quot;  Maybe more like &quot;I accept that you may deem it necessary to lock these rows.&quot;

No?]]></description>
		<content:encoded><![CDATA[<p>Please consider this off-topic comment in response to a single, isolated statement of yours (ie. not in any way a response to your overall point).  This one:</p>
<p>&#8220;If I update a row in a way that changes none of the columns I have still managed to lock the row and no-one else can modify it.  If Oracle bypasses my update simply because it appears to be redundant then it may be subverting my intentions by leaving rows modifiable by other sessions when I want them locked.&#8221;</p>
<p>Wait a minute.  You think that an update statement should GUARANTEE a certain row gets locked?</p>
<p>Update means update.  It doesn&#8217;t mean lock.  Locking is a means to an end.</p>
<p>Oracle promises you that the data integrity and consistency will be maintained while you do an update.  It does not promise you that it will lock the rows.  Locking the rows is simply the method in which they fulfill that data consistency promise.</p>
<p>When you say &#8220;I want to update these rows&#8221; I don&#8217;t think Oracle should imply &#8220;I want you to lock these rows.&#8221;  Maybe more like &#8220;I accept that you may deem it necessary to lock these rows.&#8221;</p>
<p>No?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin 't Hart</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/#comment-1097</link>
		<dc:creator><![CDATA[Colin 't Hart]]></dc:creator>
		<pubDate>Thu, 04 Jan 2007 10:22:06 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=108#comment-1097</guid>
		<description><![CDATA[Not sure if this is interesting but a TRUNCATE on an empty table leaves the LAST_DDL_TIME field intact so it seems to be skipped. But altering a table and modifying the datatype of a column to the same datatype does reset the LAST_DDL_TIME (on 10.2.0.2)

Cheers,

Colin]]></description>
		<content:encoded><![CDATA[<p>Not sure if this is interesting but a TRUNCATE on an empty table leaves the LAST_DDL_TIME field intact so it seems to be skipped. But altering a table and modifying the datatype of a column to the same datatype does reset the LAST_DDL_TIME (on 10.2.0.2)</p>
<p>Cheers,</p>
<p>Colin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antonio</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/#comment-1090</link>
		<dc:creator><![CDATA[Antonio]]></dc:creator>
		<pubDate>Thu, 04 Jan 2007 08:46:07 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=108#comment-1090</guid>
		<description><![CDATA[I was trying to figure if (for some reason) Oracle move to the undo/redo the entire db-block (i.e some rows) or only the row and then mark (in some way) the row and the value to modify.]]></description>
		<content:encoded><![CDATA[<p>I was trying to figure if (for some reason) Oracle move to the undo/redo the entire db-block (i.e some rows) or only the row and then mark (in some way) the row and the value to modify.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/#comment-1077</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 03 Jan 2007 18:47:32 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=108#comment-1077</guid>
		<description><![CDATA[Antonio, I don&#039;t quite understand your question - to update a row Oracle rewrites it with the new values, copying the old values to the undo record and (implicitly) to the redo vector for the undo record, and copying the new values to the redo vector for the table.]]></description>
		<content:encoded><![CDATA[<p>Antonio, I don&#8217;t quite understand your question &#8211; to update a row Oracle rewrites it with the new values, copying the old values to the undo record and (implicitly) to the redo vector for the undo record, and copying the new values to the redo vector for the table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SeanMacGC</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/#comment-1063</link>
		<dc:creator><![CDATA[SeanMacGC]]></dc:creator>
		<pubDate>Wed, 03 Jan 2007 10:01:34 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=108#comment-1063</guid>
		<description><![CDATA[Great Jonathan,

And I&#039;ve used the

&quot;update HISTORY SET FLAG=0 WHERE CLASS = &#039;X&#039; &lt;b&gt;and FLAG != 0&lt;/b&gt;;&quot;

more than just a few times, though usually as &lt;i&gt;NVL(FLAG,-1) != 0&lt;/i&gt; or similar, where it wasn&#039;t possible to not-null the column, or just in case that not-null constraint would disappear at some future point.

Not so straightforward when we&#039;re updating multiple columns of course, and it does get messy OR-checking each.

And yes, an &#039;off-switch&#039; would be a very good idea should Oracle introduce such a smart update &#039;feature&#039;.]]></description>
		<content:encoded><![CDATA[<p>Great Jonathan,</p>
<p>And I&#8217;ve used the</p>
<p>&#8220;update HISTORY SET FLAG=0 WHERE CLASS = &#8216;X&#8217; <b>and FLAG != 0</b>;&#8221;</p>
<p>more than just a few times, though usually as <i>NVL(FLAG,-1) != 0</i> or similar, where it wasn&#8217;t possible to not-null the column, or just in case that not-null constraint would disappear at some future point.</p>
<p>Not so straightforward when we&#8217;re updating multiple columns of course, and it does get messy OR-checking each.</p>
<p>And yes, an &#8216;off-switch&#8217; would be a very good idea should Oracle introduce such a smart update &#8216;feature&#8217;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
