<?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/"
		>
<channel>
	<title>Comments on: How to paginate through an ordered result set</title>
	<atom:link href="http://oraqa.com/2006/02/09/how-to-paginate-through-an-ordered-result-set/feed/" rel="self" type="application/rss+xml" />
	<link>http://oraqa.com/2006/02/09/how-to-paginate-through-an-ordered-result-set/</link>
	<description>Oracle Question and Answer</description>
	<lastBuildDate>Mon, 19 Dec 2011 14:21:07 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Karl Reitschuster</title>
		<link>http://oraqa.com/2006/02/09/how-to-paginate-through-an-ordered-result-set/comment-page-1/#comment-120</link>
		<dc:creator>Karl Reitschuster</dc:creator>
		<pubDate>Sat, 11 Feb 2006 18:54:36 +0000</pubDate>
		<guid isPermaLink="false">http://oraqa.com/2006/02/09/how-to-paginate-through-an-ordered-result-set/#comment-120</guid>
		<description>Thank you!
is see both variants uses the same resources.
and strange - on the second plan only 75% of CPU cost is shown;
where is the rest? But that&#039;s not a &#039;winning battle question&#039;
Regards
Karl</description>
		<content:encoded><![CDATA[<p>Thank you!<br />
is see both variants uses the same resources.<br />
and strange &#8211; on the second plan only 75% of CPU cost is shown;<br />
where is the rest? But that&#8217;s not a &#8216;winning battle question&#8217;<br />
Regards<br />
Karl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://oraqa.com/2006/02/09/how-to-paginate-through-an-ordered-result-set/comment-page-1/#comment-119</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Sat, 11 Feb 2006 04:37:35 +0000</pubDate>
		<guid isPermaLink="false">http://oraqa.com/2006/02/09/how-to-paginate-through-an-ordered-result-set/#comment-119</guid>
		<description>Using rownum:

&lt;pre&gt;
--------------------------------------------------------------------------------------
&#124; Id  &#124; Operation                &#124; Name      &#124; Rows  &#124; Bytes &#124; Cost (%CPU)&#124; Time     &#124;
--------------------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT         &#124;           &#124;   107 &#124;  3638 &#124;     4  (25)&#124; 00:00:01 &#124;
&#124;*  1 &#124;  VIEW                    &#124;           &#124;   107 &#124;  3638 &#124;     4  (25)&#124; 00:00:01 &#124;
&#124;*  2 &#124;   COUNT STOPKEY          &#124;           &#124;       &#124;       &#124;            &#124;          &#124;
&#124;   3 &#124;    VIEW                  &#124;           &#124;   107 &#124;  2247 &#124;     4  (25)&#124; 00:00:01 &#124;
&#124;*  4 &#124;     SORT ORDER BY STOPKEY&#124;           &#124;   107 &#124;  1605 &#124;     4  (25)&#124; 00:00:01 &#124;
&#124;   5 &#124;      TABLE ACCESS FULL   &#124; EMPLOYEES &#124;   107 &#124;  1605 &#124;     3   (0)&#124; 00:00:01 &#124;
--------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;R&quot;&gt;=TO_NUMBER(:LOWER))
   2 - filter(ROWNUM&lt;=TO_NUMBER(:HIGHER))
   4 - filter(ROWNUM&lt;=TO_NUMBER(:HIGHER))


Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          7  consistent gets
          0  physical reads
          0  redo size
        556  bytes sent via SQL*Net to client
        380  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
          3  rows processed
&lt;/pre&gt;

Using row_number:

&lt;pre&gt;
----------------------------------------------------------------------------------
&#124; Id  &#124; Operation            &#124; Name      &#124; Rows  &#124; Bytes &#124; Cost (%CPU)&#124; Time     &#124;
----------------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT     &#124;           &#124;   107 &#124;  3638 &#124;     4  (25)&#124; 00:00:01 &#124;
&#124;*  1 &#124;  VIEW                &#124;           &#124;   107 &#124;  3638 &#124;     4  (25)&#124; 00:00:01 &#124;
&#124;   2 &#124;   WINDOW SORT        &#124;           &#124;   107 &#124;  1605 &#124;     4  (25)&#124; 00:00:01 &#124;
&#124;*  3 &#124;    FILTER            &#124;           &#124;       &#124;       &#124;            &#124;          &#124;
&#124;   4 &#124;     TABLE ACCESS FULL&#124; EMPLOYEES &#124;   107 &#124;  1605 &#124;     3   (0)&#124; 00:00:01 &#124;
----------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;RN&quot;&gt;=TO_NUMBER(:LOWER) AND &quot;RN&quot;&lt;=TO_NUMBER(:HIGHER))
   3 - filter(TO_NUMBER(:LOWER)&lt;=TO_NUMBER(:HIGHER))


Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          7  consistent gets
          0  physical reads
          0  redo size
        556  bytes sent via SQL*Net to client
        380  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
          3  rows processed
&lt;/pre&gt;

Looks like the optimizer had to go through less steps using row_number.</description>
		<content:encoded><![CDATA[<p>Using rownum:</p>
<pre>
--------------------------------------------------------------------------------------
| Id  | Operation                | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT         |           |   107 |  3638 |     4  (25)| 00:00:01 |
|*  1 |  VIEW                    |           |   107 |  3638 |     4  (25)| 00:00:01 |
|*  2 |   COUNT STOPKEY          |           |       |       |            |          |
|   3 |    VIEW                  |           |   107 |  2247 |     4  (25)| 00:00:01 |
|*  4 |     SORT ORDER BY STOPKEY|           |   107 |  1605 |     4  (25)| 00:00:01 |
|   5 |      TABLE ACCESS FULL   | EMPLOYEES |   107 |  1605 |     3   (0)| 00:00:01 |
--------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter("R">=TO_NUMBER(:LOWER))
   2 - filter(ROWNUM< =TO_NUMBER(:HIGHER))
   4 - filter(ROWNUM<=TO_NUMBER(:HIGHER))

Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          7  consistent gets
          0  physical reads
          0  redo size
        556  bytes sent via SQL*Net to client
        380  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
          3  rows processed
</pre>
<p>Using row_number:</p>
</pre>
<pre>
----------------------------------------------------------------------------------
| Id  | Operation            | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |           |   107 |  3638 |     4  (25)| 00:00:01 |
|*  1 |  VIEW                |           |   107 |  3638 |     4  (25)| 00:00:01 |
|   2 |   WINDOW SORT        |           |   107 |  1605 |     4  (25)| 00:00:01 |
|*  3 |    FILTER            |           |       |       |            |          |
|   4 |     TABLE ACCESS FULL| EMPLOYEES |   107 |  1605 |     3   (0)| 00:00:01 |
----------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter("RN">=TO_NUMBER(:LOWER) AND "RN"< =TO_NUMBER(:HIGHER))
   3 - filter(TO_NUMBER(:LOWER)<=TO_NUMBER(:HIGHER))

Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          7  consistent gets
          0  physical reads
          0  redo size
        556  bytes sent via SQL*Net to client
        380  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
          3  rows processed
</pre>
<p>Looks like the optimizer had to go through less steps using row_number.</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Reitschuster</title>
		<link>http://oraqa.com/2006/02/09/how-to-paginate-through-an-ordered-result-set/comment-page-1/#comment-117</link>
		<dc:creator>Karl Reitschuster</dc:creator>
		<pubDate>Fri, 10 Feb 2006 10:49:30 +0000</pubDate>
		<guid isPermaLink="false">http://oraqa.com/2006/02/09/how-to-paginate-through-an-ordered-result-set/#comment-117</guid>
		<description>Hi Eddie,
how about the execution plans - are they the same?
Greetings</description>
		<content:encoded><![CDATA[<p>Hi Eddie,<br />
how about the execution plans &#8211; are they the same?<br />
Greetings</p>
]]></content:encoded>
	</item>
</channel>
</rss>

