<?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: Counting</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2009/11/25/counting/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2009/11/25/counting/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Thu, 23 May 2013 12:47:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Blogroll Report 20/11/2009-27/11/2009 &#171; Coskan&#8217;s Approach to Oracle</title>
		<link>http://jonathanlewis.wordpress.com/2009/11/25/counting/#comment-35017</link>
		<dc:creator><![CDATA[Blogroll Report 20/11/2009-27/11/2009 &#171; Coskan&#8217;s Approach to Oracle]]></dc:creator>
		<pubDate>Fri, 18 Dec 2009 00:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2526#comment-35017</guid>
		<description><![CDATA[[...] 13-How to get row count of each partition of a partitioned table? Jonathan Lewis-Counting [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 13-How to get row count of each partition of a partitioned table? Jonathan Lewis-Counting [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henish</title>
		<link>http://jonathanlewis.wordpress.com/2009/11/25/counting/#comment-34938</link>
		<dc:creator><![CDATA[Henish]]></dc:creator>
		<pubDate>Tue, 01 Dec 2009 15:10:31 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2526#comment-34938</guid>
		<description><![CDATA[Thanks Sir]]></description>
		<content:encoded><![CDATA[<p>Thanks Sir</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/11/25/counting/#comment-34926</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 30 Nov 2009 10:04:45 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2526#comment-34926</guid>
		<description><![CDATA[Henish,

You&#039;re right. Thanks for pointing out the error; I don&#039;t know how I managed to report this incorrectly, but I&#039;ve added some notes to &lt;a href=&quot;http://www.jlcomp.demon.co.uk/cbo_book/ch_13.html#_Counting_in_merge:&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;&lt;strong&gt;the Errata page&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt; for this chapter.

(Coincidentally, someone else sent me an email a couple of days ago with a list of errors and typos - including this one, and they included a pl/sql block to demonstrate arithmetic as well.)



]]></description>
		<content:encoded><![CDATA[<p>Henish,</p>
<p>You&#8217;re right. Thanks for pointing out the error; I don&#8217;t know how I managed to report this incorrectly, but I&#8217;ve added some notes to <a href="http://www.jlcomp.demon.co.uk/cbo_book/ch_13.html#_Counting_in_merge:" rel="nofollow"><em><strong>the Errata page</strong></em></a> for this chapter.</p>
<p>(Coincidentally, someone else sent me an email a couple of days ago with a list of errors and typos &#8211; including this one, and they included a pl/sql block to demonstrate arithmetic as well.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henish</title>
		<link>http://jonathanlewis.wordpress.com/2009/11/25/counting/#comment-34910</link>
		<dc:creator><![CDATA[Henish]]></dc:creator>
		<pubDate>Thu, 26 Nov 2009 15:32:46 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2526#comment-34910</guid>
		<description><![CDATA[Respected Sir,

Good Day

while reading your fabulous book &quot;cost based oracle&quot; 

In chapter 13 on pg 383 in the second last paragraph you said

&quot;for every row in t1, Oracle has located the first relevant row in the second sorted 
data set, and scanned from there to the end of the sorted data set. That&#039;s 
10,000 rows checked for the first row in t1; 9998 rows checked for the second row in t1;
9996 rows checked for the third row in t1 and so on&quot;


and here you are talking about the access predicate (t2.n2&gt;=t1.n2-1) 


Now the the column n2 in both t1 and t2 have pattern like 0,0,1,1,2,2 ......1000,1000 ....


As per access predicate first two row in t1.n2 is -1, -1 (n2-1) hence we are doing 10,000 for the first two rows in t2 
then there is 0, 0 (n2-1) for the third and fourth rows for t1.n2 hence again we are doing 10,000 for the third and fourth rows..


should not be oracle is doing 10,000 check in t2 for the first four rows in t1;
9998 for the 5th and 6th rows; 9996 for the 7th and 8th rows ......
 

Am I missing something?


Thanks]]></description>
		<content:encoded><![CDATA[<p>Respected Sir,</p>
<p>Good Day</p>
<p>while reading your fabulous book &#8220;cost based oracle&#8221; </p>
<p>In chapter 13 on pg 383 in the second last paragraph you said</p>
<p>&#8220;for every row in t1, Oracle has located the first relevant row in the second sorted<br />
data set, and scanned from there to the end of the sorted data set. That&#8217;s<br />
10,000 rows checked for the first row in t1; 9998 rows checked for the second row in t1;<br />
9996 rows checked for the third row in t1 and so on&#8221;</p>
<p>and here you are talking about the access predicate (t2.n2&gt;=t1.n2-1) </p>
<p>Now the the column n2 in both t1 and t2 have pattern like 0,0,1,1,2,2 &#8230;&#8230;1000,1000 &#8230;.</p>
<p>As per access predicate first two row in t1.n2 is -1, -1 (n2-1) hence we are doing 10,000 for the first two rows in t2<br />
then there is 0, 0 (n2-1) for the third and fourth rows for t1.n2 hence again we are doing 10,000 for the third and fourth rows..</p>
<p>should not be oracle is doing 10,000 check in t2 for the first four rows in t1;<br />
9998 for the 5th and 6th rows; 9996 for the 7th and 8th rows &#8230;&#8230;</p>
<p>Am I missing something?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timur Akhmadeev</title>
		<link>http://jonathanlewis.wordpress.com/2009/11/25/counting/#comment-34901</link>
		<dc:creator><![CDATA[Timur Akhmadeev]]></dc:creator>
		<pubDate>Wed, 25 Nov 2009 21:08:59 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2526#comment-34901</guid>
		<description><![CDATA[&gt;I’ve used the no_merge hint to allow Oracle to do the aggregation early – at the most efficient point possible.
Or you could let CBO to &lt;a href=&quot;http://jonathanlewis.wordpress.com/2008/12/21/group-by/&quot; rel=&quot;nofollow&quot;&gt;decide&lt;a&gt; which one is better ;)
&gt;If efficiency combined with flexibility is important you might be better off writing a (pipelined) pl/sql function that takes a table-name as an input and loops through each partition in turn with a simple count(*).
I disagree. In case of efficiency one should ask for &lt;a href=&quot;http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#sthref9713&quot; rel=&quot;nofollow&quot;&gt;approximate&lt;/a&gt; values for such a task.]]></description>
		<content:encoded><![CDATA[<p>&gt;I’ve used the no_merge hint to allow Oracle to do the aggregation early – at the most efficient point possible.<br />
Or you could let CBO to <a href="http://jonathanlewis.wordpress.com/2008/12/21/group-by/" rel="nofollow">decide</a><a> which one is better ;)<br />
&gt;If efficiency combined with flexibility is important you might be better off writing a (pipelined) pl/sql function that takes a table-name as an input and loops through each partition in turn with a simple count(*).<br />
I disagree. In case of efficiency one should ask for </a><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#sthref9713" rel="nofollow">approximate</a> values for such a task.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
