<?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: Over-indexing</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2013/01/10/over-indexing/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2013/01/10/over-indexing/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Wed, 19 Jun 2013 18:51:29 +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/2013/01/10/over-indexing/#comment-52786</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 12 Jan 2013 18:46:57 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10258#comment-52786</guid>
		<description><![CDATA[Noons,

The current structure for indexes was introduced in v6.

Prior to that, v5 had a compression mechanism (when machines were small and very expensive) that reduced the size of index entries using a sort of &quot;jpeg&quot; like algorithm that recorded changes in the leading edge and trailing edge. According to a comment that Dave Ensor once made (possibly during a SIG presentation in the UK) the mechanism was so aggressive that sometimes you got false positives - i.e. you had to visit the table to find out the actual value that had been encoded in the index, and it wasn&#039;t always one you wanted.

The current form of index compression is nothing like th v5 form - it&#039;s deduplication of the leading column set on a block by block basis. From memory I&#039;d say it it appeared in v8, but I wouldn&#039;t be surprised if someone told me it was v7.]]></description>
		<content:encoded><![CDATA[<p>Noons,</p>
<p>The current structure for indexes was introduced in v6.</p>
<p>Prior to that, v5 had a compression mechanism (when machines were small and very expensive) that reduced the size of index entries using a sort of &#8220;jpeg&#8221; like algorithm that recorded changes in the leading edge and trailing edge. According to a comment that Dave Ensor once made (possibly during a SIG presentation in the UK) the mechanism was so aggressive that sometimes you got false positives &#8211; i.e. you had to visit the table to find out the actual value that had been encoded in the index, and it wasn&#8217;t always one you wanted.</p>
<p>The current form of index compression is nothing like th v5 form &#8211; it&#8217;s deduplication of the leading column set on a block by block basis. From memory I&#8217;d say it it appeared in v8, but I wouldn&#8217;t be surprised if someone told me it was v7.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noons</title>
		<link>http://jonathanlewis.wordpress.com/2013/01/10/over-indexing/#comment-52776</link>
		<dc:creator><![CDATA[Noons]]></dc:creator>
		<pubDate>Sat, 12 Jan 2013 13:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10258#comment-52776</guid>
		<description><![CDATA[I can&#039;t remember when index compression was dropped as a default.  Oracle used to compress indexes in V5 and V6. I think it was in either 7 or 8 they dropped index compression  as a default setting, but can&#039;t place the actual release?]]></description>
		<content:encoded><![CDATA[<p>I can&#8217;t remember when index compression was dropped as a default.  Oracle used to compress indexes in V5 and V6. I think it was in either 7 or 8 they dropped index compression  as a default setting, but can&#8217;t place the actual release?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2013/01/10/over-indexing/#comment-52774</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 12 Jan 2013 13:19:40 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10258#comment-52774</guid>
		<description><![CDATA[Extra buffer visits, which also means extra latch activity, and an increased risk of random disk I/O
Extra undo and redo (twice as much per index entry as for a table row on an update).]]></description>
		<content:encoded><![CDATA[<p>Extra buffer visits, which also means extra latch activity, and an increased risk of random disk I/O<br />
Extra undo and redo (twice as much per index entry as for a table row on an update).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2013/01/10/over-indexing/#comment-52771</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 12 Jan 2013 13:12:59 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10258#comment-52771</guid>
		<description><![CDATA[Dom,



&lt;blockquote&gt;&lt;em&gt;&quot;And talking of things I’m guilty of, another one is being too quick to bung a couple of extra columns on the end of an index because I know one or two queries will benefit. A quick win perhaps for those one or two queries, which can arbitrarily improve some performance metric when sql tuning had already achieved the benefit required, but at the expense of making the index bigger than it needs to be for everyone else.&quot;&lt;/em&gt;&lt;/blockquote&gt;

And, repeating Mohamed&#039;s comment, the consequences of the change in clustering_factor can be even more of a problem. Wouldn&#039;t is be nice if Oracle has the same &quot;carried columns&quot; concept that SQL Server has - i.e. the ability to add columns that don&#039;t participate in the ordering of the index entries.]]></description>
		<content:encoded><![CDATA[<p>Dom,</p>
<blockquote><p><em>&#8220;And talking of things I’m guilty of, another one is being too quick to bung a couple of extra columns on the end of an index because I know one or two queries will benefit. A quick win perhaps for those one or two queries, which can arbitrarily improve some performance metric when sql tuning had already achieved the benefit required, but at the expense of making the index bigger than it needs to be for everyone else.&#8221;</em></p></blockquote>
<p>And, repeating Mohamed&#8217;s comment, the consequences of the change in clustering_factor can be even more of a problem. Wouldn&#8217;t is be nice if Oracle has the same &#8220;carried columns&#8221; concept that SQL Server has &#8211; i.e. the ability to add columns that don&#8217;t participate in the ordering of the index entries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2013/01/10/over-indexing/#comment-52770</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 12 Jan 2013 13:10:08 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10258#comment-52770</guid>
		<description><![CDATA[Mohamed,

You&#039;re quite right to emphasise how hard it can be to be change the indexes in a production system with confidence that nothing will go wrong. (Thank goodness for the advent of invisible indexes - not a 100% solution, but a most helpful option.) 

Your point about the clustering_factor is paricularly significant - I may even have an article on the blog demonstrating Oracle deciding not to use an index on (cola,colb) after dropping the index on just (cola). The change in clustering_factor can have a much more profound impact on the use of the index than the change in basic size, and it&#039;s quite hard to predict how bad things can be as a side effect.]]></description>
		<content:encoded><![CDATA[<p>Mohamed,</p>
<p>You&#8217;re quite right to emphasise how hard it can be to be change the indexes in a production system with confidence that nothing will go wrong. (Thank goodness for the advent of invisible indexes &#8211; not a 100% solution, but a most helpful option.) </p>
<p>Your point about the clustering_factor is paricularly significant &#8211; I may even have an article on the blog demonstrating Oracle deciding not to use an index on (cola,colb) after dropping the index on just (cola). The change in clustering_factor can have a much more profound impact on the use of the index than the change in basic size, and it&#8217;s quite hard to predict how bad things can be as a side effect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guest</title>
		<link>http://jonathanlewis.wordpress.com/2013/01/10/over-indexing/#comment-52726</link>
		<dc:creator><![CDATA[Guest]]></dc:creator>
		<pubDate>Fri, 11 Jan 2013 15:09:16 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10258#comment-52726</guid>
		<description><![CDATA[&quot;indexes can be very expensive to maintain&quot;.

Expensive in terms of what (latches, elapsed time, buffer gets)? And how do you calculate how expensive an index is to maintain?]]></description>
		<content:encoded><![CDATA[<p>&#8220;indexes can be very expensive to maintain&#8221;.</p>
<p>Expensive in terms of what (latches, elapsed time, buffer gets)? And how do you calculate how expensive an index is to maintain?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Houri</title>
		<link>http://jonathanlewis.wordpress.com/2013/01/10/over-indexing/#comment-52715</link>
		<dc:creator><![CDATA[Houri]]></dc:creator>
		<pubDate>Fri, 11 Jan 2013 11:36:52 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10258#comment-52715</guid>
		<description><![CDATA[Considering over indexing at a design step is very safe then considering it once in PRODUCTION. Dropping an index from an existing application is not the same thing as if we have never created it.  

What I want to emphasize is that it might exist a situation where two redundant indexes exist, t1(a,b) and t2(a) for example, and we decide to drop the t2(a) index because it is already covered by the index t1(a,b). However, we know that adding an extra column to an index might damage the clustering factor of that index. This is why t2(a) may have a better clustering factor than t1(a,b) and dropping it could make the CBO choosing another execution path that does not include an access to the remaining t1(a,b) index. This is why I always start looking at redundant index at design time.]]></description>
		<content:encoded><![CDATA[<p>Considering over indexing at a design step is very safe then considering it once in PRODUCTION. Dropping an index from an existing application is not the same thing as if we have never created it.  </p>
<p>What I want to emphasize is that it might exist a situation where two redundant indexes exist, t1(a,b) and t2(a) for example, and we decide to drop the t2(a) index because it is already covered by the index t1(a,b). However, we know that adding an extra column to an index might damage the clustering factor of that index. This is why t2(a) may have a better clustering factor than t1(a,b) and dropping it could make the CBO choosing another execution path that does not include an access to the remaining t1(a,b) index. This is why I always start looking at redundant index at design time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dom Brooks</title>
		<link>http://jonathanlewis.wordpress.com/2013/01/10/over-indexing/#comment-52714</link>
		<dc:creator><![CDATA[Dom Brooks]]></dc:creator>
		<pubDate>Fri, 11 Jan 2013 11:03:35 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10258#comment-52714</guid>
		<description><![CDATA[Two things I see a fair amount of - firstly is a reluctance or an ignorance to use composite indexes except for referential integrity (if any); secondly that redundancy when a composite index has the same leading column or columns as another index.

Index compression is probably one of the the most under utilised features in the database, I know I&#039;m guilty of just not considering it enough. I recently added it to a couple of composite indexes with 5,6 even 7 highly repetitive columns (on a wider table). Actually I&#039;m about to do some tests on making the table concerned a partitioned IOT (back again to underutilised features) with some key compression. But just the space saving on such a repetitive key composite index is great and the performance benefit is not bad either. 
But when I was looking into key compression I canvassed a couple of opinions and the general response was that they never even tend to consider it either.

And talking of things I&#039;m guilty of, another one is being too quick to bung a couple of extra columns on the end of an index because I know one or two queries will benefit. A quick win perhaps for those one or two queries, which can arbitrarily improve some performance metric when sql tuning had already achieved the benefit required, but at the expense of making the index bigger than it needs to be for everyone else.

Sometimes it can be tricky striking the right balance.]]></description>
		<content:encoded><![CDATA[<p>Two things I see a fair amount of &#8211; firstly is a reluctance or an ignorance to use composite indexes except for referential integrity (if any); secondly that redundancy when a composite index has the same leading column or columns as another index.</p>
<p>Index compression is probably one of the the most under utilised features in the database, I know I&#8217;m guilty of just not considering it enough. I recently added it to a couple of composite indexes with 5,6 even 7 highly repetitive columns (on a wider table). Actually I&#8217;m about to do some tests on making the table concerned a partitioned IOT (back again to underutilised features) with some key compression. But just the space saving on such a repetitive key composite index is great and the performance benefit is not bad either.<br />
But when I was looking into key compression I canvassed a couple of opinions and the general response was that they never even tend to consider it either.</p>
<p>And talking of things I&#8217;m guilty of, another one is being too quick to bung a couple of extra columns on the end of an index because I know one or two queries will benefit. A quick win perhaps for those one or two queries, which can arbitrarily improve some performance metric when sql tuning had already achieved the benefit required, but at the expense of making the index bigger than it needs to be for everyone else.</p>
<p>Sometimes it can be tricky striking the right balance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pablo</title>
		<link>http://jonathanlewis.wordpress.com/2013/01/10/over-indexing/#comment-52711</link>
		<dc:creator><![CDATA[Pablo]]></dc:creator>
		<pubDate>Fri, 11 Jan 2013 09:15:47 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10258#comment-52711</guid>
		<description><![CDATA[But that is not how it always is? 
Fixing something that was not properly done initially is double (or triple) the work,time and risk of doing things right from the beginning.]]></description>
		<content:encoded><![CDATA[<p>But that is not how it always is?<br />
Fixing something that was not properly done initially is double (or triple) the work,time and risk of doing things right from the beginning.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noons</title>
		<link>http://jonathanlewis.wordpress.com/2013/01/10/over-indexing/#comment-52706</link>
		<dc:creator><![CDATA[Noons]]></dc:creator>
		<pubDate>Fri, 11 Jan 2013 05:47:58 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10258#comment-52706</guid>
		<description><![CDATA[Oh man!  Can you please send that to the j2ee &quot;expert&quot; con-sultants who developed our POS system?
Let me see:

1- Table TXN_SEARCH, 51 columns

2- Number of indexes on TXN_SEARCH: 50

They: &quot;Nuno, can you check the database? Updating our searches is slow, must be something in your setup! Can you move to RAC?

Me: (after finding the above, slowly reaching for the BIG mattock handle...) Are you people completely insane?]]></description>
		<content:encoded><![CDATA[<p>Oh man!  Can you please send that to the j2ee &#8220;expert&#8221; con-sultants who developed our POS system?<br />
Let me see:</p>
<p>1- Table TXN_SEARCH, 51 columns</p>
<p>2- Number of indexes on TXN_SEARCH: 50</p>
<p>They: &#8220;Nuno, can you check the database? Updating our searches is slow, must be something in your setup! Can you move to RAC?</p>
<p>Me: (after finding the above, slowly reaching for the BIG mattock handle&#8230;) Are you people completely insane?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
