<?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: Manual Optimisation &#8211; 2</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Sat, 18 May 2013 11:04:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Todor Botev</title>
		<link>http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/#comment-52103</link>
		<dc:creator><![CDATA[Todor Botev]]></dc:creator>
		<pubDate>Thu, 13 Dec 2012 22:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=361#comment-52103</guid>
		<description><![CDATA[I used the method and it worked great. We had a big join - many rows, lots of columns selected - and the TEMP tablespace was blown away. But the nature of the system ensured that only fraction of the rows will come out as a result. So I did what you recommend here - join to select only the rowid, and for the few rows comming out, join again to select the rest of the infomation needed. It worked - thank you for iinventing and sharing it!]]></description>
		<content:encoded><![CDATA[<p>I used the method and it worked great. We had a big join &#8211; many rows, lots of columns selected &#8211; and the TEMP tablespace was blown away. But the nature of the system ensured that only fraction of the rows will come out as a result. So I did what you recommend here &#8211; join to select only the rowid, and for the few rows comming out, join again to select the rest of the infomation needed. It worked &#8211; thank you for iinventing and sharing it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/#comment-34461</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sun, 20 Sep 2009 11:28:30 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=361#comment-34461</guid>
		<description><![CDATA[I&#039;ve just added a footnote to this post to link to a question on the same topic that&#039;s just appeared on the OTN database forum.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve just added a footnote to this post to link to a question on the same topic that&#8217;s just appeared on the OTN database forum.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manual Optimisation 3 &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/#comment-32138</link>
		<dc:creator><![CDATA[Manual Optimisation 3 &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Thu, 23 Oct 2008 18:38:21 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=361#comment-32138</guid>
		<description><![CDATA[[...] Manual Optimisation&#160;3 Filed under: Execution plans, Hints, Performance, Tuning &#8212; Jonathan Lewis @ 6:38 pm UTC Oct 23,2008   [Back to Manual Optimisation part 2] [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Manual Optimisation&nbsp;3 Filed under: Execution plans, Hints, Performance, Tuning &#8212; Jonathan Lewis @ 6:38 pm UTC Oct 23,2008   [Back to Manual Optimisation part 2] [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/#comment-31027</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 13 May 2008 20:07:22 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=361#comment-31027</guid>
		<description><![CDATA[Bernard,
That would be a nice touch for drop down fields - not that I&#039;m all that keen on that type of thing, it&#039;s too easy to abuse and ruin response times, but sometimes you just have to let people do it - but it would still need some refinement for the &quot;page 2&quot; type of queries. Does MySQL have an option like &quot;LIMIT 20 LAST 10&quot; 


Matthias,
What a cute feature: &lt;i&gt;&quot;Sorry, Google does not serve more than 1000 results for any query. (You asked for results starting from 991.)&quot;&lt;/i&gt;]]></description>
		<content:encoded><![CDATA[<p>Bernard,<br />
That would be a nice touch for drop down fields &#8211; not that I&#8217;m all that keen on that type of thing, it&#8217;s too easy to abuse and ruin response times, but sometimes you just have to let people do it &#8211; but it would still need some refinement for the &#8220;page 2&#8243; type of queries. Does MySQL have an option like &#8220;LIMIT 20 LAST 10&#8243; </p>
<p>Matthias,<br />
What a cute feature: <i>&#8220;Sorry, Google does not serve more than 1000 results for any query. (You asked for results starting from 991.)&#8221;</i></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthias Rogel</title>
		<link>http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/#comment-31025</link>
		<dc:creator><![CDATA[Matthias Rogel]]></dc:creator>
		<pubDate>Tue, 13 May 2008 19:44:09 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=361#comment-31025</guid>
		<description><![CDATA[do you know about pagination-query the google style ?
(I learnt this from Tom Kyte):
try
http://www.google.com/search?q=google&amp;start=991
you query for google and all you find is - google !]]></description>
		<content:encoded><![CDATA[<p>do you know about pagination-query the google style ?<br />
(I learnt this from Tom Kyte):<br />
try<br />
<a href="http://www.google.com/search?q=google&#038;start=991" rel="nofollow">http://www.google.com/search?q=google&#038;start=991</a><br />
you query for google and all you find is &#8211; google !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Polarski Bernard</title>
		<link>http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/#comment-31021</link>
		<dc:creator><![CDATA[Polarski Bernard]]></dc:creator>
		<pubDate>Tue, 13 May 2008 07:52:24 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=361#comment-31021</guid>
		<description><![CDATA[Same feeling as L’ascolto about MySQL keyword LIMIT:  I really wonder if there is a built in Oracle engine limitation to add this keyword. It does not only concern web page builders but also any Field picker routines when you provide a part of a string in order to display all candidates rows. Something like LIMIT(20[,COLUMN][,A&#124;D)) would just means provide the first 20 rows using, if exists, any index on COLUMN in ascending or descending with the usual default features. if no index exists or it was dropped, let&#039;s perform a FT and this query will appear on top IO statspack/AWR as usual bad SQL. The main advantage of the clause would be to stop any operation when the clauses is satisfied, like EXISTS.]]></description>
		<content:encoded><![CDATA[<p>Same feeling as L’ascolto about MySQL keyword LIMIT:  I really wonder if there is a built in Oracle engine limitation to add this keyword. It does not only concern web page builders but also any Field picker routines when you provide a part of a string in order to display all candidates rows. Something like LIMIT(20[,COLUMN][,A|D)) would just means provide the first 20 rows using, if exists, any index on COLUMN in ascending or descending with the usual default features. if no index exists or it was dropped, let's perform a FT and this query will appear on top IO statspack/AWR as usual bad SQL. The main advantage of the clause would be to stop any operation when the clauses is satisfied, like EXISTS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lascoltodelvenerdi</title>
		<link>http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/#comment-31018</link>
		<dc:creator><![CDATA[lascoltodelvenerdi]]></dc:creator>
		<pubDate>Tue, 13 May 2008 06:28:45 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=361#comment-31018</guid>
		<description><![CDATA[Thank you Jonathan for the clarification.]]></description>
		<content:encoded><![CDATA[<p>Thank you Jonathan for the clarification.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/#comment-31011</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 12 May 2008 20:41:11 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=361#comment-31011</guid>
		<description><![CDATA[lascoltodelvenerdi,

It&#039;s not quite accurate to say that the rowid is copied into the undo segment - but it&#039;s close enough to explain why there is no read-consistency problem.

Here&#039;s a sample undo record from 9.2.0.8 after a simple update to a single column:
&lt;code&gt;
*-----------------------------
*&#160;Rec&#160;#0x1f&#160;&#160;slt: 0x00&#160; objn: 46117(0x0000b425)&#160; objd:&#160;46117&#160; tblspc:&#160;9(0x00000009)
*&#160;&#160;&#160;&#160;&#160;&#160;&#160;Layer:&#160;&#160;11&#160;(Row)&#160;&#160;&#160;opc:&#160;1&#160;&#160;&#160;rci&#160;0x00&#160;&#160;&#160;
Undo&#160;type:&#160;&#160;Regular&#160;undo&#160;&#160;&#160;&#160;Begin&#160;trans&#160;&#160;&#160;&#160;Last&#160;buffer&#160;split:&#160;&#160;No&#160;
Temp&#160;Object:&#160;&#160;No&#160;
Tablespace&#160;Undo:&#160;&#160;No&#160;
rdba:&#160;0x00000000
*-----------------------------
uba:&#160;0x0080005b.0aef.1e&#160;ctl&#160;max&#160;scn:&#160;0x0000.07e73982&#160;prv&#160;tx&#160;scn:&#160;0x0000.07e7415c
KDO&#160;undo&#160;record:
KTB&#160;Redo&#160;
op:&#160;0x03&#160;&#160;ver:&#160;0x01&#160;&#160;
op:&#160;Z
KDO&#160;Op&#160;code:&#160;URP&#160;row&#160;dependencies&#160;Disabled
&#160;&#160;xtype:&#160;XA&#160;&#160;bdba:&#160;0x0240038a&#160;&#160;hdba:&#160;0x02400389
itli:&#160;3&#160;&#160;ispac:&#160;0&#160;&#160;maxfr:&#160;4863
tabn:&#160;0&#160;slot:&#160;15(0xf)&#160;flag:&#160;0x2c&#160;lock:&#160;0&#160;ckix:&#160;0
ncol:&#160;4&#160;nnew:&#160;1&#160;size:&#160;-2
col&#160;&#160;3:&#160;[&#160;1]&#160;&#160;31
&lt;/code&gt;
Notice the reference to:
The object number and data object number:&lt;b&gt;objn: 46117, objd: 46117 &lt;/b&gt;
The block address of the block:  &lt;b&gt;bdba: 0x0240038a&lt;/b&gt;
The table number within block (for clusters): &lt;b&gt;tabn: 0 &lt;/b&gt;
The row directory entry within block (which is the &#039;row_number&#039; component of the rowid &lt;b&gt;slot: 15&lt;/b&gt;

The rowid isn&#039;t in the undo - but it&#039;s part of the undo.]]></description>
		<content:encoded><![CDATA[<p>lascoltodelvenerdi,</p>
<p>It&#8217;s not quite accurate to say that the rowid is copied into the undo segment &#8211; but it&#8217;s close enough to explain why there is no read-consistency problem.</p>
<p>Here&#8217;s a sample undo record from 9.2.0.8 after a simple update to a single column:<br />
<code><br />
*-----------------------------<br />
*&nbsp;Rec&nbsp;#0x1f&nbsp;&nbsp;slt: 0x00&nbsp; objn: 46117(0x0000b425)&nbsp; objd:&nbsp;46117&nbsp; tblspc:&nbsp;9(0x00000009)<br />
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Layer:&nbsp;&nbsp;11&nbsp;(Row)&nbsp;&nbsp;&nbsp;opc:&nbsp;1&nbsp;&nbsp;&nbsp;rci&nbsp;0x00&nbsp;&nbsp;&nbsp;<br />
Undo&nbsp;type:&nbsp;&nbsp;Regular&nbsp;undo&nbsp;&nbsp;&nbsp;&nbsp;Begin&nbsp;trans&nbsp;&nbsp;&nbsp;&nbsp;Last&nbsp;buffer&nbsp;split:&nbsp;&nbsp;No&nbsp;<br />
Temp&nbsp;Object:&nbsp;&nbsp;No&nbsp;<br />
Tablespace&nbsp;Undo:&nbsp;&nbsp;No&nbsp;<br />
rdba:&nbsp;0x00000000<br />
*-----------------------------<br />
uba:&nbsp;0x0080005b.0aef.1e&nbsp;ctl&nbsp;max&nbsp;scn:&nbsp;0x0000.07e73982&nbsp;prv&nbsp;tx&nbsp;scn:&nbsp;0x0000.07e7415c<br />
KDO&nbsp;undo&nbsp;record:<br />
KTB&nbsp;Redo&nbsp;<br />
op:&nbsp;0x03&nbsp;&nbsp;ver:&nbsp;0x01&nbsp;&nbsp;<br />
op:&nbsp;Z<br />
KDO&nbsp;Op&nbsp;code:&nbsp;URP&nbsp;row&nbsp;dependencies&nbsp;Disabled<br />
&nbsp;&nbsp;xtype:&nbsp;XA&nbsp;&nbsp;bdba:&nbsp;0x0240038a&nbsp;&nbsp;hdba:&nbsp;0x02400389<br />
itli:&nbsp;3&nbsp;&nbsp;ispac:&nbsp;0&nbsp;&nbsp;maxfr:&nbsp;4863<br />
tabn:&nbsp;0&nbsp;slot:&nbsp;15(0xf)&nbsp;flag:&nbsp;0x2c&nbsp;lock:&nbsp;0&nbsp;ckix:&nbsp;0<br />
ncol:&nbsp;4&nbsp;nnew:&nbsp;1&nbsp;size:&nbsp;-2<br />
col&nbsp;&nbsp;3:&nbsp;[&nbsp;1]&nbsp;&nbsp;31<br />
</code><br />
Notice the reference to:<br />
The object number and data object number:<b>objn: 46117, objd: 46117 </b><br />
The block address of the block:  <b>bdba: 0x0240038a</b><br />
The table number within block (for clusters): <b>tabn: 0 </b><br />
The row directory entry within block (which is the &#8216;row_number&#8217; component of the rowid <b>slot: 15</b></p>
<p>The rowid isn&#8217;t in the undo &#8211; but it&#8217;s part of the undo.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lascoltodelvenerdi</title>
		<link>http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/#comment-31008</link>
		<dc:creator><![CDATA[lascoltodelvenerdi]]></dc:creator>
		<pubDate>Mon, 12 May 2008 10:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=361#comment-31008</guid>
		<description><![CDATA[Every time I read of &quot;pagination-query&quot; I feel the need of the MySql &quot;LIMIT&quot; keyword! :(

But, on the other hand, we must admit that Oracle and MySql are two very different DB.

Only a question (but I think the answer is yes because of read consistency): the  rowid is copied in the undo segment (or temp) along with the rest of the row data?

In another way: There&#039;s no possibility that I try to access a row that someone else deleted from the db.]]></description>
		<content:encoded><![CDATA[<p>Every time I read of &#8220;pagination-query&#8221; I feel the need of the MySql &#8220;LIMIT&#8221; keyword! :(</p>
<p>But, on the other hand, we must admit that Oracle and MySql are two very different DB.</p>
<p>Only a question (but I think the answer is yes because of read consistency): the  rowid is copied in the undo segment (or temp) along with the rest of the row data?</p>
<p>In another way: There&#8217;s no possibility that I try to access a row that someone else deleted from the db.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/05/09/manual-optimisation-2/#comment-31003</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 10 May 2008 16:33:22 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=361#comment-31003</guid>
		<description><![CDATA[Stew,

If you check back to the previous posting in this series, you&#039;ll see that my initial question about this query was: &lt;i&gt;&quot;Why does someone want to see 300,000 rows from the database?&quot;&lt;/i&gt; So Tom and I agree on that.

Having said that, if someone really thinks it&#039;s necessary, then you need to be able to do it. There&#039;s also the argument that you may need a technique like this when you only want to see the first few pages of a set that can&#039;t be identified easily anyway.

I didn&#039;t think of the &lt;b&gt;cardinality()&lt;/b&gt; hint - it&#039;s quite a cute option in this case.  But the point remains that it&#039;s still a hint and you have to check all hinted code on every patch and upgrade. You never know, one day Oracle may deprecate the &lt;b&gt;cardinality()&lt;/b&gt; hint in favour of the &lt;b&gt;opt_estimate()&lt;/b&gt; equivalent - remember the &lt;b&gt;selectivity()&lt;/b&gt; hint ?]]></description>
		<content:encoded><![CDATA[<p>Stew,</p>
<p>If you check back to the previous posting in this series, you&#8217;ll see that my initial question about this query was: <i>&#8220;Why does someone want to see 300,000 rows from the database?&#8221;</i> So Tom and I agree on that.</p>
<p>Having said that, if someone really thinks it&#8217;s necessary, then you need to be able to do it. There&#8217;s also the argument that you may need a technique like this when you only want to see the first few pages of a set that can&#8217;t be identified easily anyway.</p>
<p>I didn&#8217;t think of the <b>cardinality()</b> hint &#8211; it&#8217;s quite a cute option in this case.  But the point remains that it&#8217;s still a hint and you have to check all hinted code on every patch and upgrade. You never know, one day Oracle may deprecate the <b>cardinality()</b> hint in favour of the <b>opt_estimate()</b> equivalent &#8211; remember the <b>selectivity()</b> hint ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
