<?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: Index Efficiency 2</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/</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: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/#comment-37163</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 01 Sep 2010 17:01:50 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1051#comment-37163</guid>
		<description><![CDATA[Jithin,

I&#039;ve added a link to the Script Catalogue to the end of the article. There are two scripts there that can help you identify indexes where a coalesce would be sufficient; both do a lot of work since they read the index one block at a time, but they don&#039;t cause any locking. One of them generates a statistical report of leaf block usage, the other &lt;a href=&quot;http://jonathanlewis.wordpress.com/2010/03/07/treedump-2/&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;&lt;strong&gt;&quot;draws a picture&quot;&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt; of the index leaf level.]]></description>
		<content:encoded><![CDATA[<p>Jithin,</p>
<p>I&#8217;ve added a link to the Script Catalogue to the end of the article. There are two scripts there that can help you identify indexes where a coalesce would be sufficient; both do a lot of work since they read the index one block at a time, but they don&#8217;t cause any locking. One of them generates a statistical report of leaf block usage, the other <a href="http://jonathanlewis.wordpress.com/2010/03/07/treedump-2/" rel="nofollow"><em><strong>&#8220;draws a picture&#8221;</strong></em></a> of the index leaf level.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jithin Sarath</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/#comment-37161</link>
		<dc:creator><![CDATA[Jithin Sarath]]></dc:creator>
		<pubDate>Wed, 01 Sep 2010 14:24:40 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1051#comment-37161</guid>
		<description><![CDATA[Jonathan, 
Apologies. I now understand the use of &quot;scaling factor&quot;. It&#039;s been a very long week and I just could not concentrate. Spending some time with the family seems to have helped and I was now casually going thro the code - and it hit me on the face :).

However, the doubt on coalesce still stands though.]]></description>
		<content:encoded><![CDATA[<p>Jonathan,<br />
Apologies. I now understand the use of &#8220;scaling factor&#8221;. It&#8217;s been a very long week and I just could not concentrate. Spending some time with the family seems to have helped and I was now casually going thro the code &#8211; and it hit me on the face :).</p>
<p>However, the doubt on coalesce still stands though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jithin Sarath</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/#comment-37158</link>
		<dc:creator><![CDATA[Jithin Sarath]]></dc:creator>
		<pubDate>Wed, 01 Sep 2010 11:48:28 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1051#comment-37158</guid>
		<description><![CDATA[Hi Jonathan,
 We are upgrading from 9.2.0.6 to 11gR2 and I was assigned the task of redesigning the index rebuild process. As you have mention at several places across your blog, I work for a company where IT managers force the DBA to have regular index rebuilds. At present the indexes are chosen as per what oracle states %deleted &gt;=30 and height&gt;3. 

It takes us approx 8 hours!! to complete the &#039;validate structur&#039;e for all indexes (on a daily clone). 

Your script caught my attention and I&#039;m trying to use it ti identify worthy candidates for rebuild. On this regard, could you please elaborate on the relevance of the &quot;scaling factor&quot; used? 

I&#039;m also trying to decide on what to rebuild and what all to coalesce. Any inputs you have will be great!


Jithin]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,<br />
 We are upgrading from 9.2.0.6 to 11gR2 and I was assigned the task of redesigning the index rebuild process. As you have mention at several places across your blog, I work for a company where IT managers force the DBA to have regular index rebuilds. At present the indexes are chosen as per what oracle states %deleted &gt;=30 and height&gt;3. </p>
<p>It takes us approx 8 hours!! to complete the &#8216;validate structur&#8217;e for all indexes (on a daily clone). </p>
<p>Your script caught my attention and I&#8217;m trying to use it ti identify worthy candidates for rebuild. On this regard, could you please elaborate on the relevance of the &#8220;scaling factor&#8221; used? </p>
<p>I&#8217;m also trying to decide on what to rebuild and what all to coalesce. Any inputs you have will be great!</p>
<p>Jithin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blogroll Report 26/02/2010 – 05/03/2010 &#171; Coskan&#8217;s Approach to Oracle</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/#comment-35872</link>
		<dc:creator><![CDATA[Blogroll Report 26/02/2010 – 05/03/2010 &#171; Coskan&#8217;s Approach to Oracle]]></dc:creator>
		<pubDate>Thu, 25 Mar 2010 13:49:34 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1051#comment-35872</guid>
		<description><![CDATA[[...] 12-How to estimate index size with a simple script when stats are available? Jonathan Lewis-Index Efficiency-2 [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 12-How to estimate index size with a simple script when stats are available? Jonathan Lewis-Index Efficiency-2 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Index Efficiency 3 &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/#comment-35671</link>
		<dc:creator><![CDATA[Index Efficiency 3 &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Wed, 03 Mar 2010 21:21:15 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1051#comment-35671</guid>
		<description><![CDATA[[...] Efficiency&#160;3 Filed under: Uncategorized &#8212; Jonathan Lewis @ 9:20 pm UTC Mar 3,2010   My last posting about indexes was an introduction to a pl/sql script that estimated the sizes that your indexes would be [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Efficiency&nbsp;3 Filed under: Uncategorized &#8212; Jonathan Lewis @ 9:20 pm UTC Mar 3,2010   My last posting about indexes was an introduction to a pl/sql script that estimated the sizes that your indexes would be [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/#comment-35667</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 02 Mar 2010 20:53:17 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1051#comment-35667</guid>
		<description><![CDATA[Josh,

The main flaws are in the notes in the script. The biggest, perhaps, is that it doesn&#039;t cope with compression at all.  There&#039;s also a problem with rounding errors and approximations when you have a lot of nulls in the columns that make up the index.  It&#039;s very easy to get an approximation which is much larger than the final index would actually be.]]></description>
		<content:encoded><![CDATA[<p>Josh,</p>
<p>The main flaws are in the notes in the script. The biggest, perhaps, is that it doesn&#8217;t cope with compression at all.  There&#8217;s also a problem with rounding errors and approximations when you have a lot of nulls in the columns that make up the index.  It&#8217;s very easy to get an approximation which is much larger than the final index would actually be.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/#comment-35666</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 02 Mar 2010 20:51:46 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1051#comment-35666</guid>
		<description><![CDATA[Franck,

I made a few comments about the dbms_xplan feature a few months ago: http://jonathanlewis.wordpress.com/2009/05/22/index-size/

Your use of dbms_metadata.get_ddl is very elegant.]]></description>
		<content:encoded><![CDATA[<p>Franck,</p>
<p>I made a few comments about the dbms_xplan feature a few months ago: <a href="http://jonathanlewis.wordpress.com/2009/05/22/index-size/" rel="nofollow">http://jonathanlewis.wordpress.com/2009/05/22/index-size/</a></p>
<p>Your use of dbms_metadata.get_ddl is very elegant.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/#comment-35664</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 02 Mar 2010 20:46:14 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1051#comment-35664</guid>
		<description><![CDATA[Padders,

This looks like it may be one of the bugs associated with ASSM and the difficulty of choosing a moment to update the bitmaps to show that a block is free.

Any updates which do a massive delete followed by inserts run a risk of making indexes bigger than they need to be. This is because Oracle cannot re-use the space in an index block until the transaction has committed - even for rows inserted by the same transaction (except for one special case).  The same thing happens with tables, in fact, but the mechanics are different and the effect is much less noticeable. (See http://jonathanlewis.wordpress.com/2009/05/20/lunchtime-quiz/ for more details.)

Since you&#039;re on 10g with materialized views, I&#039;d guess that you are doing atomic refreshes, which means Oracle deletes everything from the MVs and their indexes, then re-inserts, then commits - which fits a critical pattern.

You could experiment by putting a couple of your indexes into a tablespace using freelist management to see the problem &quot;magically&quot; disappears. Alternatively just schedule a &quot;coalesce&quot; on all the problem indexes immediately after the refresh.]]></description>
		<content:encoded><![CDATA[<p>Padders,</p>
<p>This looks like it may be one of the bugs associated with ASSM and the difficulty of choosing a moment to update the bitmaps to show that a block is free.</p>
<p>Any updates which do a massive delete followed by inserts run a risk of making indexes bigger than they need to be. This is because Oracle cannot re-use the space in an index block until the transaction has committed &#8211; even for rows inserted by the same transaction (except for one special case).  The same thing happens with tables, in fact, but the mechanics are different and the effect is much less noticeable. (See <a href="http://jonathanlewis.wordpress.com/2009/05/20/lunchtime-quiz/" rel="nofollow">http://jonathanlewis.wordpress.com/2009/05/20/lunchtime-quiz/</a> for more details.)</p>
<p>Since you&#8217;re on 10g with materialized views, I&#8217;d guess that you are doing atomic refreshes, which means Oracle deletes everything from the MVs and their indexes, then re-inserts, then commits &#8211; which fits a critical pattern.</p>
<p>You could experiment by putting a couple of your indexes into a tablespace using freelist management to see the problem &#8220;magically&#8221; disappears. Alternatively just schedule a &#8220;coalesce&#8221; on all the problem indexes immediately after the refresh.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: josh</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/#comment-35661</link>
		<dc:creator><![CDATA[josh]]></dc:creator>
		<pubDate>Tue, 02 Mar 2010 06:42:05 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1051#comment-35661</guid>
		<description><![CDATA[hi Jonathan,

nice post ,just out of curiousity do you mind sharing what was the flaws in the original script and what are the defects we should take note in the calculation


Thanks]]></description>
		<content:encoded><![CDATA[<p>hi Jonathan,</p>
<p>nice post ,just out of curiousity do you mind sharing what was the flaws in the original script and what are the defects we should take note in the calculation</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Franck Pachot</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/28/index-efficiency-2/#comment-35658</link>
		<dc:creator><![CDATA[Franck Pachot]]></dc:creator>
		<pubDate>Mon, 01 Mar 2010 20:36:53 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1051#comment-35658</guid>
		<description><![CDATA[Hi,

Did you compare your estimation of index size with the one Oracle provides when doing explain plan on the create index statement ?

Here is an example to get estimated size for all current user indexes:
[sourcecode]
begin
 for r in ( select index_name from user_indexes ) loop
  execute immediate &#039;explain plan set statement_id=&#039;&#039;&#039;&#124;&#124;r.index_name&#124;&#124;&#039;&#039;&#039; for &#039;&#124;&#124;
  dbms_metadata.get_ddl(&#039;INDEX&#039;,r.index_name);
 end loop;
end;
/
select object_owner,object_name
 ,cast(extractvalue(xmltype(other_xml),&#039;/other_xml/info[@type=&quot;index_size&quot;]&#039;) as number) estimated_index_size 
from plan_table p where id=1;
[/sourcecode]

Regards,
Franck.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Did you compare your estimation of index size with the one Oracle provides when doing explain plan on the create index statement ?</p>
<p>Here is an example to get estimated size for all current user indexes:</p>
<pre class="brush: plain; title: ; notranslate">
begin
 for r in ( select index_name from user_indexes ) loop
  execute immediate 'explain plan set statement_id='''||r.index_name||''' for '||
  dbms_metadata.get_ddl('INDEX',r.index_name);
 end loop;
end;
/
select object_owner,object_name
 ,cast(extractvalue(xmltype(other_xml),'/other_xml/info[@type=&quot;index_size&quot;]') as number) estimated_index_size 
from plan_table p where id=1;
</pre>
<p>Regards,<br />
Franck.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
