<?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 Explosion &#8211; 4</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2009/09/15/index-explosion-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2009/09/15/index-explosion-4/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Sun, 19 May 2013 12:40: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/2009/09/15/index-explosion-4/#comment-40150</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 26 Mar 2011 20:08:32 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2096#comment-40150</guid>
		<description><![CDATA[Subrata Saha,

&lt;em&gt;1.Can you please explain why you have recommended to hash on the first column only.&lt;/em&gt;
I wasn&#039;t thinking in a sufficiently general way - my thoughts were focused too much on the case of the sequence based key with a high rate of insert. The hashing has to be on the leading columns of a globally partitioned index (i.e. &lt;em&gt;&lt;strong&gt;global&lt;/strong&gt;&lt;/em&gt; partitioned indexes have to be &lt;a href=&quot;http://jonathanlewis.wordpress.com/2011/02/28/prefixed/&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;&lt;strong&gt;prefixed&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt;), but doesn&#039;t have to be restricted to just the first column.

&lt;em&gt;2.Is this hashing only helpful during concurrent inserts &quot;by spreading across blocks”? What is the impact during retrieval?&lt;/em&gt;
I think that you&#039;ll find that that point is addressed in the third paragraph of the section. depending on the nature of the predicates it can introduce extra work on the retrieval.

&lt;em&gt;3. Consider this, I have a column with low cardinality. Will not adding a column (primary-key) in the hash function reduce hash-collisions and spreading?&lt;/em&gt;

That&#039;s a point worth raising, but there are a couple of different scenarios to consider, for example:

If you have periods of time where the high concurrency is all about just one distinct value, then hashing on that column is clearly NOT going to spread the load - so you have to have at least a second column in the index with a large number of distinct values and a two-column hash to spread the load; but then your queries have to be &lt;em&gt;&quot;where col1 = constant and col2 = constant&quot;&lt;/em&gt; if you want them to be efficient. Of course, you might consider creating the index with the less repetitive column first, hashing on just that column because then you could use the index efficiently for queries that involved both columns or just the less repetitive column.

If your periods of high concurrency use several of your &quot;low cardinality&quot; values then it&#039;s possible that that is, of itself, sufficient to spread the load across a number of different insertion points, making the partitioning unnecessary. 

In passing, if your &quot;low cardinality&quot; column is the leading column of an index it&#039;s worth looking at compressing the index on that column.]]></description>
		<content:encoded><![CDATA[<p>Subrata Saha,</p>
<p><em>1.Can you please explain why you have recommended to hash on the first column only.</em><br />
I wasn&#8217;t thinking in a sufficiently general way &#8211; my thoughts were focused too much on the case of the sequence based key with a high rate of insert. The hashing has to be on the leading columns of a globally partitioned index (i.e. <em><strong>global</strong></em> partitioned indexes have to be <a href="http://jonathanlewis.wordpress.com/2011/02/28/prefixed/" rel="nofollow"><em><strong>prefixed</strong></em></a>), but doesn&#8217;t have to be restricted to just the first column.</p>
<p><em>2.Is this hashing only helpful during concurrent inserts &#8220;by spreading across blocks”? What is the impact during retrieval?</em><br />
I think that you&#8217;ll find that that point is addressed in the third paragraph of the section. depending on the nature of the predicates it can introduce extra work on the retrieval.</p>
<p><em>3. Consider this, I have a column with low cardinality. Will not adding a column (primary-key) in the hash function reduce hash-collisions and spreading?</em></p>
<p>That&#8217;s a point worth raising, but there are a couple of different scenarios to consider, for example:</p>
<p>If you have periods of time where the high concurrency is all about just one distinct value, then hashing on that column is clearly NOT going to spread the load &#8211; so you have to have at least a second column in the index with a large number of distinct values and a two-column hash to spread the load; but then your queries have to be <em>&#8220;where col1 = constant and col2 = constant&#8221;</em> if you want them to be efficient. Of course, you might consider creating the index with the less repetitive column first, hashing on just that column because then you could use the index efficiently for queries that involved both columns or just the less repetitive column.</p>
<p>If your periods of high concurrency use several of your &#8220;low cardinality&#8221; values then it&#8217;s possible that that is, of itself, sufficient to spread the load across a number of different insertion points, making the partitioning unnecessary. </p>
<p>In passing, if your &#8220;low cardinality&#8221; column is the leading column of an index it&#8217;s worth looking at compressing the index on that column.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: subrata saha</title>
		<link>http://jonathanlewis.wordpress.com/2009/09/15/index-explosion-4/#comment-40107</link>
		<dc:creator><![CDATA[subrata saha]]></dc:creator>
		<pubDate>Tue, 22 Mar 2011 20:47:29 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2096#comment-40107</guid>
		<description><![CDATA[Hello Jonathan You said:
&quot;Create the index as a globally hash partitioned index, partitioned on the first column of the index.&quot;

1.Can you please explain why you have recommended to hash 
  on the first column only.

2.Is this hashing only helpful during concurrent inserts 
  &quot;by spreading across blocks&quot;? What is the impact during 
   retrieval?

3. Consider this, I have a column with low cardinality.
   Will not adding a column (primary-key) in the hash 
   function reduce hash-collisions and spreading?]]></description>
		<content:encoded><![CDATA[<p>Hello Jonathan You said:<br />
&#8220;Create the index as a globally hash partitioned index, partitioned on the first column of the index.&#8221;</p>
<p>1.Can you please explain why you have recommended to hash<br />
  on the first column only.</p>
<p>2.Is this hashing only helpful during concurrent inserts<br />
  &#8220;by spreading across blocks&#8221;? What is the impact during<br />
   retrieval?</p>
<p>3. Consider this, I have a column with low cardinality.<br />
   Will not adding a column (primary-key) in the hash<br />
   function reduce hash-collisions and spreading?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Index ITL &#171; Timur Akhmadeev&#039;s blog</title>
		<link>http://jonathanlewis.wordpress.com/2009/09/15/index-explosion-4/#comment-36100</link>
		<dc:creator><![CDATA[Index ITL &#171; Timur Akhmadeev&#039;s blog]]></dc:creator>
		<pubDate>Tue, 27 Apr 2010 19:57:26 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2096#comment-36100</guid>
		<description><![CDATA[[...] to several other articles. As it turned out in a recent thread on SQL.ru forum, one of possible solutions to the issue &#8211; calling ALTER index COALESCE &#8211; appears to be very limited in it&#8217;s [...]]]></description>
		<content:encoded><![CDATA[<p>[...] to several other articles. As it turned out in a recent thread on SQL.ru forum, one of possible solutions to the issue &#8211; calling ALTER index COALESCE &#8211; appears to be very limited in it&#8217;s [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kevin jones</title>
		<link>http://jonathanlewis.wordpress.com/2009/09/15/index-explosion-4/#comment-34552</link>
		<dc:creator><![CDATA[kevin jones]]></dc:creator>
		<pubDate>Fri, 02 Oct 2009 09:43:11 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2096#comment-34552</guid>
		<description><![CDATA[Luckily we are moving to a 4-way cluster and will be running in parallel for a while and we have some time booked to rebuild all the global indexes and reclaim about 200Gb of space which will cheer up our accountants.]]></description>
		<content:encoded><![CDATA[<p>Luckily we are moving to a 4-way cluster and will be running in parallel for a while and we have some time booked to rebuild all the global indexes and reclaim about 200Gb of space which will cheer up our accountants.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/09/15/index-explosion-4/#comment-34545</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 01 Oct 2009 18:17:35 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2096#comment-34545</guid>
		<description><![CDATA[Kevin,

It sounds as if you&#039;ve been dropping partitions with the &quot;update (global) indexes&quot; option. 

Nice to hear that the coalesce is a more appropriate solution.

You may still need to do one more rebuild, though, if you&#039;ve allowed a history of drops to accumulate, as you may now have N partitions worth of empty space on your index freelists when perhaps you want to get that down to a steady state of just one partition&#039;s worth of space.

It&#039;s typical of sorting out indexing problems - once you&#039;ve figured out the correct strategy, you sometimes have to do just one more rebuild (with the correct configuration) before you can tick all the boxes.]]></description>
		<content:encoded><![CDATA[<p>Kevin,</p>
<p>It sounds as if you&#8217;ve been dropping partitions with the &#8220;update (global) indexes&#8221; option. </p>
<p>Nice to hear that the coalesce is a more appropriate solution.</p>
<p>You may still need to do one more rebuild, though, if you&#8217;ve allowed a history of drops to accumulate, as you may now have N partitions worth of empty space on your index freelists when perhaps you want to get that down to a steady state of just one partition&#8217;s worth of space.</p>
<p>It&#8217;s typical of sorting out indexing problems &#8211; once you&#8217;ve figured out the correct strategy, you sometimes have to do just one more rebuild (with the correct configuration) before you can tick all the boxes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kevin jones</title>
		<link>http://jonathanlewis.wordpress.com/2009/09/15/index-explosion-4/#comment-34539</link>
		<dc:creator><![CDATA[kevin jones]]></dc:creator>
		<pubDate>Thu, 01 Oct 2009 09:25:38 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2096#comment-34539</guid>
		<description><![CDATA[I have, for the first time, run coalesce index against 406Gb of global indexes on partitioned tables with a date partition key and can confirm that it is wonderful with absolutely no affect on the application. The space used by the indexes is no longer growing. It took about 20 hours to do and created an awful lot of redo c. 200Gb so one needs to get plenty of archive log jobs running. Previoulsy we did periodic index rebuuilds which was always painful.]]></description>
		<content:encoded><![CDATA[<p>I have, for the first time, run coalesce index against 406Gb of global indexes on partitioned tables with a date partition key and can confirm that it is wonderful with absolutely no affect on the application. The space used by the indexes is no longer growing. It took about 20 hours to do and created an awful lot of redo c. 200Gb so one needs to get plenty of archive log jobs running. Previoulsy we did periodic index rebuuilds which was always painful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/09/15/index-explosion-4/#comment-34483</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 21 Sep 2009 19:00:06 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2096#comment-34483</guid>
		<description><![CDATA[Christo,

The reason for considering the partition strategy is two-fold - first you hope that after partitioning the index once you don&#039;t have to rebuild; and second even if you never see the ITL problem, there are indexes of this type that see buffer busy waits and other contention and partitioning can deal with those waits.  But as I said, it is important to consider how you&#039;re going to use the index in queries or you may lose more than you gain.]]></description>
		<content:encoded><![CDATA[<p>Christo,</p>
<p>The reason for considering the partition strategy is two-fold &#8211; first you hope that after partitioning the index once you don&#8217;t have to rebuild; and second even if you never see the ITL problem, there are indexes of this type that see buffer busy waits and other contention and partitioning can deal with those waits.  But as I said, it is important to consider how you&#8217;re going to use the index in queries or you may lose more than you gain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hash Partitions &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2009/09/15/index-explosion-4/#comment-34478</link>
		<dc:creator><![CDATA[Hash Partitions &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Mon, 21 Sep 2009 17:58:38 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2096#comment-34478</guid>
		<description><![CDATA[[...] posting about using powers of two for the number of partitions when using hash partitioning. The article in question was talking ab0ut globally partitioned indexes, but the principal was first associated with [...]]]></description>
		<content:encoded><![CDATA[<p>[...] posting about using powers of two for the number of partitions when using hash partitioning. The article in question was talking ab0ut globally partitioned indexes, but the principal was first associated with [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christo Kutrovsky</title>
		<link>http://jonathanlewis.wordpress.com/2009/09/15/index-explosion-4/#comment-34474</link>
		<dc:creator><![CDATA[Christo Kutrovsky]]></dc:creator>
		<pubDate>Mon, 21 Sep 2009 13:55:16 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2096#comment-34474</guid>
		<description><![CDATA[Thanks Jonathan !

So I had the usage wrong, I was using ora_hash(id,8) for 8 partitions instead of ora_hash(id,7). Just tested it out, seems to work for both strings and numbers!

I&#039;ll review that chapter again. In the case of an index however, wouldn&#039;t it be easier to rebuild it, rather than re-partition? Not that I don&#039;t like power of 2, just trying to understand the logic behind it. To avoid having rules of thumb without knowing where the &quot;thumb&quot; comes from :)]]></description>
		<content:encoded><![CDATA[<p>Thanks Jonathan !</p>
<p>So I had the usage wrong, I was using ora_hash(id,8) for 8 partitions instead of ora_hash(id,7). Just tested it out, seems to work for both strings and numbers!</p>
<p>I&#8217;ll review that chapter again. In the case of an index however, wouldn&#8217;t it be easier to rebuild it, rather than re-partition? Not that I don&#8217;t like power of 2, just trying to understand the logic behind it. To avoid having rules of thumb without knowing where the &#8220;thumb&#8221; comes from :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/09/15/index-explosion-4/#comment-34458</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 19 Sep 2009 16:19:13 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2096#comment-34458</guid>
		<description><![CDATA[Christo,

This was a topic I covered in &lt;em&gt;&quot;Practical Oracle 8i&quot;&lt;/em&gt; Chapter 12.  The &lt;em&gt;&quot;power of 2&quot;&lt;/em&gt; implementation makes it relatively painless to increase or decrease the number of partitions in a hash-partitioned table as you don&#039;t have to redistribute all the data in the table, only the data of one (to split) or two (to merge) partitions.

When I wrote the book, 8i had a packaged procedure &lt;em&gt;&lt;strong&gt;dbms_utility.get_hash_value()&lt;/strong&gt;&lt;/em&gt; that could be used to return the hash partition position for a string value; but things may have changed since then. The &lt;em&gt;&lt;strong&gt;ora_hash()&lt;/strong&gt;&lt;/em&gt; function returns the internal partition if used correctly. 

Example:  &lt;em&gt;&lt;strong&gt;ora_hash(38454,7)&lt;/strong&gt;&lt;/em&gt; will return the internal partition number (0 to 7, rather than 1 to 8 ) of the hash partition that should hold the value 38454 if you have created a table with eight hash partitions.
]]></description>
		<content:encoded><![CDATA[<p>Christo,</p>
<p>This was a topic I covered in <em>&#8220;Practical Oracle 8i&#8221;</em> Chapter 12.  The <em>&#8220;power of 2&#8243;</em> implementation makes it relatively painless to increase or decrease the number of partitions in a hash-partitioned table as you don&#8217;t have to redistribute all the data in the table, only the data of one (to split) or two (to merge) partitions.</p>
<p>When I wrote the book, 8i had a packaged procedure <em><strong>dbms_utility.get_hash_value()</strong></em> that could be used to return the hash partition position for a string value; but things may have changed since then. The <em><strong>ora_hash()</strong></em> function returns the internal partition if used correctly. </p>
<p>Example:  <em><strong>ora_hash(38454,7)</strong></em> will return the internal partition number (0 to 7, rather than 1 to 8 ) of the hash partition that should hold the value 38454 if you have created a table with eight hash partitions.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
