<?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: Test Data</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2011/12/08/test-data/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2011/12/08/test-data/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Wed, 19 Jun 2013 22:21:35 +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/2011/12/08/test-data/#comment-43041</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sun, 11 Dec 2011 14:20:52 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=7747#comment-43041</guid>
		<description><![CDATA[Sokrates,

Thanks for that link. It&#039;s worthing knowing. I&#039;ll have to try to remember to fix up my examples from now on to use the right method; fortunately it&#039;s not something I&#039;ve ever put into production code (I think).]]></description>
		<content:encoded><![CDATA[<p>Sokrates,</p>
<p>Thanks for that link. It&#8217;s worthing knowing. I&#8217;ll have to try to remember to fix up my examples from now on to use the right method; fortunately it&#8217;s not something I&#8217;ve ever put into production code (I think).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2011/12/08/test-data/#comment-43039</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sun, 11 Dec 2011 13:17:42 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=7747#comment-43039</guid>
		<description><![CDATA[Yuri,

I should have edited that column out, I was running the test on a multi-CPU 32-bit virtual machine running Windows XP Pro, guesting under Windows 7 on a 64-bit multi-core machine, and the combinatin seems to do some strange things with timing occasionally.

In theory the plan is claiming that the query took about 5 minutes to run, when in practice the real elapsed time was much smaller.]]></description>
		<content:encoded><![CDATA[<p>Yuri,</p>
<p>I should have edited that column out, I was running the test on a multi-CPU 32-bit virtual machine running Windows XP Pro, guesting under Windows 7 on a 64-bit multi-core machine, and the combinatin seems to do some strange things with timing occasionally.</p>
<p>In theory the plan is claiming that the query took about 5 minutes to run, when in practice the real elapsed time was much smaller.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yuri</title>
		<link>http://jonathanlewis.wordpress.com/2011/12/08/test-data/#comment-42970</link>
		<dc:creator><![CDATA[Yuri]]></dc:creator>
		<pubDate>Fri, 09 Dec 2011 11:28:05 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=7747#comment-42970</guid>
		<description><![CDATA[What does the A-Time=00:04:57.76 or 00:04:56.47 mean? You mentioned 4 seconds and 8 seconds for both your queries respectively.]]></description>
		<content:encoded><![CDATA[<p>What does the A-Time=00:04:57.76 or 00:04:56.47 mean? You mentioned 4 seconds and 8 seconds for both your queries respectively.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sokrates</title>
		<link>http://jonathanlewis.wordpress.com/2011/12/08/test-data/#comment-42969</link>
		<dc:creator><![CDATA[Sokrates]]></dc:creator>
		<pubDate>Fri, 09 Dec 2011 10:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=7747#comment-42969</guid>
		<description><![CDATA[according to Tom Kyte (if I understood him correctly), it is a bug that
[sourcecode]
select
        rownum id
from
        dual
connect by
        rownum &lt;= 4000
[/sourcecode]
returns the same as

[sourcecode]
select
        level id
from
        dual
connect by
        level &lt;= 4000
[/sourcecode]
see
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:12718072439781#36409968445172]]></description>
		<content:encoded><![CDATA[<p>according to Tom Kyte (if I understood him correctly), it is a bug that</p>
<pre class="brush: plain; title: ; notranslate">
select
        rownum id
from
        dual
connect by
        rownum &lt;= 4000
</pre>
<p>returns the same as</p>
<pre class="brush: plain; title: ; notranslate">
select
        level id
from
        dual
connect by
        level &lt;= 4000
</pre>
<p>see<br />
<a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0" rel="nofollow">http://asktom.oracle.com/pls/asktom/f?p=100:11:0</a>::::P11_QUESTION_ID:12718072439781#36409968445172</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2011/12/08/test-data/#comment-42957</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Fri, 09 Dec 2011 05:56:20 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=7747#comment-42957</guid>
		<description><![CDATA[Richard,

Thanks for the link - the follow-on to Adrian Billington&#039;s article on the topic is particularly useful: http://www.oracle-developer.net/display.php?id=408.

I am curious about the comment on Tanel&#039;s article that the &quot;with subquery&quot; approach being faster than the inlne view - I only used &quot;with&quot; because I used to use &quot;select rownum from all_objects&quot; to generate the starting rows and either &quot;with&quot; or  &quot;no_merge&quot; was a necessity, so I never checked for speed when I changed to the &quot;connect by&quot; approach.
]]></description>
		<content:encoded><![CDATA[<p>Richard,</p>
<p>Thanks for the link &#8211; the follow-on to Adrian Billington&#8217;s article on the topic is particularly useful: <a href="http://www.oracle-developer.net/display.php?id=408" rel="nofollow">http://www.oracle-developer.net/display.php?id=408</a>.</p>
<p>I am curious about the comment on Tanel&#8217;s article that the &#8220;with subquery&#8221; approach being faster than the inlne view &#8211; I only used &#8220;with&#8221; because I used to use &#8220;select rownum from all_objects&#8221; to generate the starting rows and either &#8220;with&#8221; or  &#8220;no_merge&#8221; was a necessity, so I never checked for speed when I changed to the &#8220;connect by&#8221; approach.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Valentin Nikotin</title>
		<link>http://jonathanlewis.wordpress.com/2011/12/08/test-data/#comment-42946</link>
		<dc:creator><![CDATA[Valentin Nikotin]]></dc:creator>
		<pubDate>Thu, 08 Dec 2011 20:10:54 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=7747#comment-42946</guid>
		<description><![CDATA[And this is the fastest way that I have found to count to 1e7 
[sourcecode]
create or replace function generator (n pls_integer) return sys.odcinumberlist pipelined is
  m pls_integer := trunc(n / 10);
  r pls_integer := n - 10 * m;
begin
  for i in 1 .. m loop
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
  end loop;  
  for i in 1 .. r loop
    pipe row (null);
  end loop;
end;
/
alter function generator compile plsql_code_type = native;

It&#039;s 0.67sec, but if I add rownum into count - time increases to 1.6sec:

SQL&gt; set timing on
SQL&gt; select count(*) from table(generator(1e7));

  COUNT(*)
----------
  10000000

Elapsed: 00:00:00.67
SQL&gt; select count(rownum) from table(generator(1e7));

COUNT(ROWNUM)
-------------
     10000000

Elapsed: 00:00:01.60
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>And this is the fastest way that I have found to count to 1e7 </p>
<pre class="brush: plain; title: ; notranslate">
create or replace function generator (n pls_integer) return sys.odcinumberlist pipelined is
  m pls_integer := trunc(n / 10);
  r pls_integer := n - 10 * m;
begin
  for i in 1 .. m loop
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
    pipe row (null);
  end loop;  
  for i in 1 .. r loop
    pipe row (null);
  end loop;
end;
/
alter function generator compile plsql_code_type = native;

It's 0.67sec, but if I add rownum into count - time increases to 1.6sec:

SQL&gt; set timing on
SQL&gt; select count(*) from table(generator(1e7));

  COUNT(*)
----------
  10000000

Elapsed: 00:00:00.67
SQL&gt; select count(rownum) from table(generator(1e7));

COUNT(ROWNUM)
-------------
     10000000

Elapsed: 00:00:01.60
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://jonathanlewis.wordpress.com/2011/12/08/test-data/#comment-42945</link>
		<dc:creator><![CDATA[Richard]]></dc:creator>
		<pubDate>Thu, 08 Dec 2011 19:39:26 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=7747#comment-42945</guid>
		<description><![CDATA[Hi Jonathan,

 have you checked this?

   http://blog.tanelpoder.com/2008/06/08/generating-lots-of-rows-using-connect-by-safely/

Greetings.]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p> have you checked this?</p>
<p>   <a href="http://blog.tanelpoder.com/2008/06/08/generating-lots-of-rows-using-connect-by-safely/" rel="nofollow">http://blog.tanelpoder.com/2008/06/08/generating-lots-of-rows-using-connect-by-safely/</a></p>
<p>Greetings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2011/12/08/test-data/#comment-42944</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 08 Dec 2011 19:16:40 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=7747#comment-42944</guid>
		<description><![CDATA[Martin,

I should probably have pointed out that the increase in the PGA memory was due to the increase in the UGA - which is located inside the PGA.]]></description>
		<content:encoded><![CDATA[<p>Martin,</p>
<p>I should probably have pointed out that the increase in the PGA memory was due to the increase in the UGA &#8211; which is located inside the PGA.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2011/12/08/test-data/#comment-42943</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 08 Dec 2011 19:14:05 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=7747#comment-42943</guid>
		<description><![CDATA[Valentin,

Very nice - and it&#039;s only 1.18 seconds on my laptop (although that goes up to 2.23 if I gather plan statistics). More significantly it&#039;s another option that doesn&#039;t use a lot of memory.]]></description>
		<content:encoded><![CDATA[<p>Valentin,</p>
<p>Very nice &#8211; and it&#8217;s only 1.18 seconds on my laptop (although that goes up to 2.23 if I gather plan statistics). More significantly it&#8217;s another option that doesn&#8217;t use a lot of memory.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mwidlake</title>
		<link>http://jonathanlewis.wordpress.com/2011/12/08/test-data/#comment-42941</link>
		<dc:creator><![CDATA[mwidlake]]></dc:creator>
		<pubDate>Thu, 08 Dec 2011 18:54:57 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=7747#comment-42941</guid>
		<description><![CDATA[I&#039;m a &quot;level&quot; guy myself, I think it looks more natural for some reason.

I did wonder during the talk if there was going to be any real difference between using the subquery generator and a cartesian product or just the simple select with a larger value for rownum (level). You said the more complex form was quicker but not really how much {you did only have 10 minutes}.  I was going to test it myself, so you have saved me the task. I think I will change how I generate my test data.

BTW I think you need to tidy up the info on PGA and UGA, as it stands it shows a massive increase in usage for both and you only say PGA in the text.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m a &#8220;level&#8221; guy myself, I think it looks more natural for some reason.</p>
<p>I did wonder during the talk if there was going to be any real difference between using the subquery generator and a cartesian product or just the simple select with a larger value for rownum (level). You said the more complex form was quicker but not really how much {you did only have 10 minutes}.  I was going to test it myself, so you have saved me the task. I think I will change how I generate my test data.</p>
<p>BTW I think you need to tidy up the info on PGA and UGA, as it stands it shows a massive increase in usage for both and you only say PGA in the text.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
