<?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: Recursive SQL</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2012/07/13/recursive-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2012/07/13/recursive-sql/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Fri, 24 May 2013 13:27:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/07/13/recursive-sql/#comment-52063</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 13 Dec 2012 11:39:19 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9181#comment-52063</guid>
		<description><![CDATA[Greg,

I&#039;m always allowed to say: &quot;I don&#039;t know, I didn&#039;t write the spec or the code.&quot;

I can think of a few arguments for why the row cache is a good idea, though, here&#039;s one. Oracle developers ought to assume that people will design bad applications and find themselves constantly optimising SQL statements. To optimise a statement you have to check whether or not the objects referenced exist and aren&#039;t being created, changed, or destroyed, so you need a mechanism to lock the object definition temporarily.

If you kept all the information in the data buffer, how would you lock the rows in the data buffer in a way that didn&#039;t modify the data blocks (i.e. didn&#039;t generate undo and redo) but ensured no-one could could change the row. Apart from using a whole data buffer to hold one row in memory, you&#039;d have to write a layer of code that crossed the normal buffer handing code and introduced a level of complexity that would make it much harder to modify either set of code (i.e. the data handling code and the optimisation code).]]></description>
		<content:encoded><![CDATA[<p>Greg,</p>
<p>I&#8217;m always allowed to say: &#8220;I don&#8217;t know, I didn&#8217;t write the spec or the code.&#8221;</p>
<p>I can think of a few arguments for why the row cache is a good idea, though, here&#8217;s one. Oracle developers ought to assume that people will design bad applications and find themselves constantly optimising SQL statements. To optimise a statement you have to check whether or not the objects referenced exist and aren&#8217;t being created, changed, or destroyed, so you need a mechanism to lock the object definition temporarily.</p>
<p>If you kept all the information in the data buffer, how would you lock the rows in the data buffer in a way that didn&#8217;t modify the data blocks (i.e. didn&#8217;t generate undo and redo) but ensured no-one could could change the row. Apart from using a whole data buffer to hold one row in memory, you&#8217;d have to write a layer of code that crossed the normal buffer handing code and introduced a level of complexity that would make it much harder to modify either set of code (i.e. the data handling code and the optimisation code).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: goryszewskig</title>
		<link>http://jonathanlewis.wordpress.com/2012/07/13/recursive-sql/#comment-52056</link>
		<dc:creator><![CDATA[goryszewskig]]></dc:creator>
		<pubDate>Thu, 13 Dec 2012 10:49:17 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9181#comment-52056</guid>
		<description><![CDATA[Jonathan, I&#039;ve always wondered why You have to have dc_segments whereas seg$ table blocks are as well cached in buffer cache .
Seems like double buffering for me .
Could You please elaborate about that ?
Regards
GregG]]></description>
		<content:encoded><![CDATA[<p>Jonathan, I&#8217;ve always wondered why You have to have dc_segments whereas seg$ table blocks are as well cached in buffer cache .<br />
Seems like double buffering for me .<br />
Could You please elaborate about that ?<br />
Regards<br />
GregG</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olivier Bernhard</title>
		<link>http://jonathanlewis.wordpress.com/2012/07/13/recursive-sql/#comment-48226</link>
		<dc:creator><![CDATA[Olivier Bernhard]]></dc:creator>
		<pubDate>Sun, 22 Jul 2012 17:36:59 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9181#comment-48226</guid>
		<description><![CDATA[Many thanks for your very clear inputs !
Olivier]]></description>
		<content:encoded><![CDATA[<p>Many thanks for your very clear inputs !<br />
Olivier</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/07/13/recursive-sql/#comment-48192</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 21 Jul 2012 15:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9181#comment-48192</guid>
		<description><![CDATA[Olivier,

There&#039;s no obvious reason, although it might simply be a question of simplicity of code. At this point, of course, Oracle doesn&#039;t know which partition it&#039;s going to use because that information embedded in the partition definition (tabpart$) rather than the segment definition - but I think Oracle gets that various bits of object partition information before it gets the segment information anyway.

It&#039;s interesting to note two things. First, the calls to tabpart$ and indpart$ don&#039;t follow the same pattern - it&#039;s one execution for the table, one for each index, with a large array fetch to get the data for all the partitions in one got. Secondly, the results above are from 11.2, and you don&#039;t see any parse calls reported for the query against seg$, in 11.1 there is a parse call for every execution.

I suspect that there&#039;s some history attached to this code - in the good old days partitioned objects tended to have only a few partitions, so this single-row processing didn&#039;t seem to introduce much overhead, and the strategy probably made it easy to deal with generic code that had to handle heap table, and IOTs, and any other possible partitioned object - I suspect that what were seeing is just the effect of code that has been written with implicit cursor loops that avoids writing more complex code that deals with several variants of joins between seg$ and other data dictionary tables.]]></description>
		<content:encoded><![CDATA[<p>Olivier,</p>
<p>There&#8217;s no obvious reason, although it might simply be a question of simplicity of code. At this point, of course, Oracle doesn&#8217;t know which partition it&#8217;s going to use because that information embedded in the partition definition (tabpart$) rather than the segment definition &#8211; but I think Oracle gets that various bits of object partition information before it gets the segment information anyway.</p>
<p>It&#8217;s interesting to note two things. First, the calls to tabpart$ and indpart$ don&#8217;t follow the same pattern &#8211; it&#8217;s one execution for the table, one for each index, with a large array fetch to get the data for all the partitions in one got. Secondly, the results above are from 11.2, and you don&#8217;t see any parse calls reported for the query against seg$, in 11.1 there is a parse call for every execution.</p>
<p>I suspect that there&#8217;s some history attached to this code &#8211; in the good old days partitioned objects tended to have only a few partitions, so this single-row processing didn&#8217;t seem to introduce much overhead, and the strategy probably made it easy to deal with generic code that had to handle heap table, and IOTs, and any other possible partitioned object &#8211; I suspect that what were seeing is just the effect of code that has been written with implicit cursor loops that avoids writing more complex code that deals with several variants of joins between seg$ and other data dictionary tables.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olivier Bernhard</title>
		<link>http://jonathanlewis.wordpress.com/2012/07/13/recursive-sql/#comment-48185</link>
		<dc:creator><![CDATA[Olivier Bernhard]]></dc:creator>
		<pubDate>Sat, 21 Jul 2012 12:06:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9181#comment-48185</guid>
		<description><![CDATA[Jonathan, any obvious reason for oracle to load all dc segments related to the partitioned object (partition segments) while single partition is likely to be accessed ? We are using tables with hundreds of thousands partitions and accessing only one partition results in a huge amount of these recursive statements and also possibly related to many ora-4031 i have to troubleshoot. Thx. Olivier.
Ps : this is occuring on 11.2.0.3 where i also had to disable multiple subpools because of a known memory leak in shared pool when managing lots of partitions and only fixed in 12beta.]]></description>
		<content:encoded><![CDATA[<p>Jonathan, any obvious reason for oracle to load all dc segments related to the partitioned object (partition segments) while single partition is likely to be accessed ? We are using tables with hundreds of thousands partitions and accessing only one partition results in a huge amount of these recursive statements and also possibly related to many ora-4031 i have to troubleshoot. Thx. Olivier.<br />
Ps : this is occuring on 11.2.0.3 where i also had to disable multiple subpools because of a known memory leak in shared pool when managing lots of partitions and only fixed in 12beta.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Log Buffer #277, A Carnival of the Vanities for DBAs &#124; The Pythian Blog</title>
		<link>http://jonathanlewis.wordpress.com/2012/07/13/recursive-sql/#comment-47943</link>
		<dc:creator><![CDATA[Log Buffer #277, A Carnival of the Vanities for DBAs &#124; The Pythian Blog]]></dc:creator>
		<pubDate>Sat, 14 Jul 2012 04:18:41 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9181#comment-47943</guid>
		<description><![CDATA[[...] table was doing so much physical I/O to get a very small amount of data from a single partition. Jonathan Lewis [...]]]></description>
		<content:encoded><![CDATA[<p>[...] table was doing so much physical I/O to get a very small amount of data from a single partition. Jonathan Lewis [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
