<?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: Quiz Night</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Tue, 18 Jun 2013 04:32:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: A Few Random Notes &#171; Richard Foote&#8217;s Oracle Blog</title>
		<link>http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/#comment-40801</link>
		<dc:creator><![CDATA[A Few Random Notes &#171; Richard Foote&#8217;s Oracle Blog]]></dc:creator>
		<pubDate>Sat, 18 Jun 2011 12:42:36 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=6305#comment-40801</guid>
		<description><![CDATA[[...] out his Night Quiz blog entry for an excellent discussion on how things might be better, worse, unchanged or possibly [...]]]></description>
		<content:encoded><![CDATA[<p>[...] out his Night Quiz blog entry for an excellent discussion on how things might be better, worse, unchanged or possibly [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Foote</title>
		<link>http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/#comment-40775</link>
		<dc:creator><![CDATA[Richard Foote]]></dc:creator>
		<pubDate>Thu, 16 Jun 2011 11:57:37 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=6305#comment-40775</guid>
		<description><![CDATA[Hi KC

Because when looking for the MIN of a value, Oracle can generally use the index via the index full scan min/max access method to find the first leaf block and hence find the minimum value. However, if this block contains nothing but empty index entries, it has to keep looking and so hops across to the second leaf block and so on and so on until it finds the first non-deleted value. If you delete 90% of index entries and they&#039;re all on the &quot;left hand&quot; of the index, you might need to access 90% of the entire index, a single block read at a time to find the min value (maybe 1000s of LIOs) when previously it found it straight away. Hence, it&#039;s an example of performance being much worse than previously.]]></description>
		<content:encoded><![CDATA[<p>Hi KC</p>
<p>Because when looking for the MIN of a value, Oracle can generally use the index via the index full scan min/max access method to find the first leaf block and hence find the minimum value. However, if this block contains nothing but empty index entries, it has to keep looking and so hops across to the second leaf block and so on and so on until it finds the first non-deleted value. If you delete 90% of index entries and they&#8217;re all on the &#8220;left hand&#8221; of the index, you might need to access 90% of the entire index, a single block read at a time to find the min value (maybe 1000s of LIOs) when previously it found it straight away. Hence, it&#8217;s an example of performance being much worse than previously.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pachot</title>
		<link>http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/#comment-40772</link>
		<dc:creator><![CDATA[pachot]]></dc:creator>
		<pubDate>Wed, 15 Jun 2011 19:50:38 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=6305#comment-40772</guid>
		<description><![CDATA[I wonder if it has a sense to compare performance when the result is different. Most of the answers are concerning different result because of the deleted rows. It would be interresting to think of worse/same/better reasons as well for the same query giving the same result...]]></description>
		<content:encoded><![CDATA[<p>I wonder if it has a sense to compare performance when the result is different. Most of the answers are concerning different result because of the deleted rows. It would be interresting to think of worse/same/better reasons as well for the same query giving the same result&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donatello Settembrino</title>
		<link>http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/#comment-40770</link>
		<dc:creator><![CDATA[Donatello Settembrino]]></dc:creator>
		<pubDate>Wed, 15 Jun 2011 17:51:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=6305#comment-40770</guid>
		<description><![CDATA[SAME:
If the retrieved data required the use of index blocks which were not affected by the delete, the performance will not change.

BETTER:
If the retrieved data required the use of index blocks that have been affected by the delete, the performance will be better because you do not have access to the corresponding blocks of the table.

Note that the index blocks will be taken to buffer cache anyway, even if empty.

WORSE:
After the cancellation of 90% of the data(and recalculation of the statistics), if the clustering factor is high (for high, I mean a number very close to the number of rows in the table), the optimizer might choose a table scan and then read up to HWM, which means reading all blocks, even those subjected to delete (if you&#039;re not taking Reorg).

Regards,

Donatello Settembrino]]></description>
		<content:encoded><![CDATA[<p>SAME:<br />
If the retrieved data required the use of index blocks which were not affected by the delete, the performance will not change.</p>
<p>BETTER:<br />
If the retrieved data required the use of index blocks that have been affected by the delete, the performance will be better because you do not have access to the corresponding blocks of the table.</p>
<p>Note that the index blocks will be taken to buffer cache anyway, even if empty.</p>
<p>WORSE:<br />
After the cancellation of 90% of the data(and recalculation of the statistics), if the clustering factor is high (for high, I mean a number very close to the number of rows in the table), the optimizer might choose a table scan and then read up to HWM, which means reading all blocks, even those subjected to delete (if you&#8217;re not taking Reorg).</p>
<p>Regards,</p>
<p>Donatello Settembrino</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kc</title>
		<link>http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/#comment-40769</link>
		<dc:creator><![CDATA[kc]]></dc:creator>
		<pubDate>Wed, 15 Jun 2011 13:05:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=6305#comment-40769</guid>
		<description><![CDATA[Hi Richard,
Can you please explain your Example of Worse ? How the performnace will be worse compare to if all left index entries had data in them to find MIN and if optimizer decides to use Index ?  

thanks
kc]]></description>
		<content:encoded><![CDATA[<p>Hi Richard,<br />
Can you please explain your Example of Worse ? How the performnace will be worse compare to if all left index entries had data in them to find MIN and if optimizer decides to use Index ?  </p>
<p>thanks<br />
kc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darryl Griffiths</title>
		<link>http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/#comment-40764</link>
		<dc:creator><![CDATA[Darryl Griffiths]]></dc:creator>
		<pubDate>Tue, 14 Jun 2011 18:11:56 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=6305#comment-40764</guid>
		<description><![CDATA[This must depend on the size of the table and complexity of both table and indexes.

SAME: If the table is small, then would the delete not have put the modified blocks into the buffer cache?  Plus the index would have been read during the DELETE and would also reside in the buffer cache.  Therefore not performing any other modifications to the table or the index, the performance difference would be so dramatically small as to be un-noticeable (is this how we are measuring the performance?).

WORSE: If the table or index is large (maybe too large to fit in the buffer cache or gets aged out almost immediately), then we start talking about physical reads on the table or index and I can&#039;t think that hard but I think the others have nailed it when they talk about traversals and differing index methods.

BETTER: The performance would be better if you have a partitioned index/table and you delete the records 90% of which happen to be in one partition.  The range scan will have significantly less work to do as the other partition(s) would have been dropped (??).]]></description>
		<content:encoded><![CDATA[<p>This must depend on the size of the table and complexity of both table and indexes.</p>
<p>SAME: If the table is small, then would the delete not have put the modified blocks into the buffer cache?  Plus the index would have been read during the DELETE and would also reside in the buffer cache.  Therefore not performing any other modifications to the table or the index, the performance difference would be so dramatically small as to be un-noticeable (is this how we are measuring the performance?).</p>
<p>WORSE: If the table or index is large (maybe too large to fit in the buffer cache or gets aged out almost immediately), then we start talking about physical reads on the table or index and I can&#8217;t think that hard but I think the others have nailed it when they talk about traversals and differing index methods.</p>
<p>BETTER: The performance would be better if you have a partitioned index/table and you delete the records 90% of which happen to be in one partition.  The range scan will have significantly less work to do as the other partition(s) would have been dropped (??).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilesh Rajapurkar</title>
		<link>http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/#comment-40751</link>
		<dc:creator><![CDATA[Nilesh Rajapurkar]]></dc:creator>
		<pubDate>Sat, 11 Jun 2011 09:40:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=6305#comment-40751</guid>
		<description><![CDATA[Hi Jonathan,

If I delete 90% of my rows, then performance of the queries is based on following scenarios - 

1. If query is doing range scan, then there will not be any impact. Only thing here is if after rebuild, blevel of the index reduces then I have to do one less IO.
2. If query is doing Index Full/Fast Full scan, then there will be huge impact on the query. 
3. My full Table scan will impact. This is not related to index rebuild but I have to do table reorg as well. 

Thanks

Nilesh Rajapurkar]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>If I delete 90% of my rows, then performance of the queries is based on following scenarios &#8211; </p>
<p>1. If query is doing range scan, then there will not be any impact. Only thing here is if after rebuild, blevel of the index reduces then I have to do one less IO.<br />
2. If query is doing Index Full/Fast Full scan, then there will be huge impact on the query.<br />
3. My full Table scan will impact. This is not related to index rebuild but I have to do table reorg as well. </p>
<p>Thanks</p>
<p>Nilesh Rajapurkar</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hourim</title>
		<link>http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/#comment-40750</link>
		<dc:creator><![CDATA[hourim]]></dc:creator>
		<pubDate>Sat, 11 Jun 2011 08:37:17 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=6305#comment-40750</guid>
		<description><![CDATA[Suppose that the deleted table contains indexes that are based on monotonically increased sequences i.e. indexes based on a sequence; and the 90% delete concerns the left hand side of the index, and the deleted free space will not be re-used by subsequent inserts; we will then have an index that will become full of data only on its right hand side. If we apply the sys_op_lbid function to this index then we will point out that the number of keys per leaf block will be such that this index is smashed and not efficient and need to be coalesced (the same thing could be said about an index based on a date last_update_date for example). 

Another example of worse is the High water mark of the table. FULL table scans will be of a high cost if nothing is done on the table and the deleted space keep empty and not inserted again. 

But if we shrink the table to set its High Water Mark, we might damage the Clustering Factor of the indexes and hence decrease their desirability by the CBO.

Finally it’s all about the delete pattern and how the rows are scattered through the table indexes and the effect this delete will have on this data scattering 

Best regards

Mohamed Houri]]></description>
		<content:encoded><![CDATA[<p>Suppose that the deleted table contains indexes that are based on monotonically increased sequences i.e. indexes based on a sequence; and the 90% delete concerns the left hand side of the index, and the deleted free space will not be re-used by subsequent inserts; we will then have an index that will become full of data only on its right hand side. If we apply the sys_op_lbid function to this index then we will point out that the number of keys per leaf block will be such that this index is smashed and not efficient and need to be coalesced (the same thing could be said about an index based on a date last_update_date for example). </p>
<p>Another example of worse is the High water mark of the table. FULL table scans will be of a high cost if nothing is done on the table and the deleted space keep empty and not inserted again. </p>
<p>But if we shrink the table to set its High Water Mark, we might damage the Clustering Factor of the indexes and hence decrease their desirability by the CBO.</p>
<p>Finally it’s all about the delete pattern and how the rows are scattered through the table indexes and the effect this delete will have on this data scattering </p>
<p>Best regards</p>
<p>Mohamed Houri</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flado</title>
		<link>http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/#comment-40748</link>
		<dc:creator><![CDATA[Flado]]></dc:creator>
		<pubDate>Sat, 11 Jun 2011 07:34:50 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=6305#comment-40748</guid>
		<description><![CDATA[Worse: If the delete happened in a single transaction, and assuming a large table, the first range scan after the commit will have to do some massive cleanouts and re-formats of the leaf blocks, thus generating some serious redo.
Same: Since the blevel hasn&#039;t changed, short, equality-based range scans looking for still-existing keys will see no difference.
With bitmap indexes, it will all depend on how the deleted rows were distributed; for versions prior to 10g it will always be worse.]]></description>
		<content:encoded><![CDATA[<p>Worse: If the delete happened in a single transaction, and assuming a large table, the first range scan after the commit will have to do some massive cleanouts and re-formats of the leaf blocks, thus generating some serious redo.<br />
Same: Since the blevel hasn&#8217;t changed, short, equality-based range scans looking for still-existing keys will see no difference.<br />
With bitmap indexes, it will all depend on how the deleted rows were distributed; for versions prior to 10g it will always be worse.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jametong</title>
		<link>http://jonathanlewis.wordpress.com/2011/06/10/quiz-night-13/#comment-40747</link>
		<dc:creator><![CDATA[jametong]]></dc:creator>
		<pubDate>Sat, 11 Jun 2011 04:41:08 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=6305#comment-40747</guid>
		<description><![CDATA[It depends on how you query the data, or what is the data distribution of the range scan predicates.

1. does the result set of the range scan changed so much or almost no change.
2. does the range scan followed by a index filter or table filter.
3. does the range scan followed by a stop key by count.

a. If the predicates is nearly unique, the range scan performance will remain unchanged or will have a minor improvement(by eliminate the leaf block or table block scan).
b. If the result set is based on a stop key by count, and there are so many rows map this predicates, the scan performance may be will degrade.
c. If the result set will be significantly decreased, then the scan performance will be improved significantly.]]></description>
		<content:encoded><![CDATA[<p>It depends on how you query the data, or what is the data distribution of the range scan predicates.</p>
<p>1. does the result set of the range scan changed so much or almost no change.<br />
2. does the range scan followed by a index filter or table filter.<br />
3. does the range scan followed by a stop key by count.</p>
<p>a. If the predicates is nearly unique, the range scan performance will remain unchanged or will have a minor improvement(by eliminate the leaf block or table block scan).<br />
b. If the result set is based on a stop key by count, and there are so many rows map this predicates, the scan performance may be will degrade.<br />
c. If the result set will be significantly decreased, then the scan performance will be improved significantly.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
