<?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/"
		>
<channel>
	<title>Comments on: Redundant index is not always bad</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/</link>
	<description>Everything about MySQL Performance</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:23:57 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: bob</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/comment-page-1/#comment-183223</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Thu, 01 Nov 2007 22:59:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/#comment-183223</guid>
		<description>I would be very upset if someone wanted to index on (state,city,address).   Address is too big to be useful in an index (it will limit the # records/page and just doesn&#039;t make sense.  

It would be interesting to repeat the tests with just (state,city).


This of course ignores all international issues which should impose an index of (country_id,state,city).

note that this is also messy since it makes for a very deep index as opposed to a wide index (i.e. you have to traverse more btree nodes to get to your data).


Also the inserts should take longer,  you&#039;re building a much larger index in the 2nd case and causing many more page balances just due to the fact that each page will hold fewer index items.</description>
		<content:encoded><![CDATA[<p>I would be very upset if someone wanted to index on (state,city,address).   Address is too big to be useful in an index (it will limit the # records/page and just doesn&#8217;t make sense.  </p>
<p>It would be interesting to repeat the tests with just (state,city).</p>
<p>This of course ignores all international issues which should impose an index of (country_id,state,city).</p>
<p>note that this is also messy since it makes for a very deep index as opposed to a wide index (i.e. you have to traverse more btree nodes to get to your data).</p>
<p>Also the inserts should take longer,  you&#8217;re building a much larger index in the 2nd case and causing many more page balances just due to the fact that each page will hold fewer index items.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/comment-page-1/#comment-160600</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Thu, 30 Aug 2007 00:23:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/#comment-160600</guid>
		<description>I mean redundant indexes. Say one with &#039;cola&#039; and another with &#039;(cola, colb)&#039;. The merge intersect will not work in a query that doesn&#039;t use &#039;colb&#039; so you need to add both indexes if you want to use the merge intersect. Also I don&#039;t want to optimize by adding muti-key indexes to every possible combinations of filters a user might have and would rather use the merge intersect for many things. Then this gets the the secondary problem that if you have two redundant indexes and you are filtering on &#039;cola&#039; and &#039;colb&#039; it will often choose to use both indexes with merge intersect which is completly a waste of time as only the muti-key index should be used and not the single &#039;cola&#039; index.</description>
		<content:encoded><![CDATA[<p>I mean redundant indexes. Say one with &#8216;cola&#8217; and another with &#8216;(cola, colb)&#8217;. The merge intersect will not work in a query that doesn&#8217;t use &#8216;colb&#8217; so you need to add both indexes if you want to use the merge intersect. Also I don&#8217;t want to optimize by adding muti-key indexes to every possible combinations of filters a user might have and would rather use the merge intersect for many things. Then this gets the the secondary problem that if you have two redundant indexes and you are filtering on &#8216;cola&#8217; and &#8216;colb&#8217; it will often choose to use both indexes with merge intersect which is completly a waste of time as only the muti-key index should be used and not the single &#8216;cola&#8217; index.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/comment-page-1/#comment-160312</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Wed, 29 Aug 2007 07:50:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/#comment-160312</guid>
		<description>Ryan,

Are you speaking about duplicate indexes or redundant (as vadim is speaking) ? 
What problem do you mean ?</description>
		<content:encoded><![CDATA[<p>Ryan,</p>
<p>Are you speaking about duplicate indexes or redundant (as vadim is speaking) ?<br />
What problem do you mean ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/comment-page-1/#comment-160310</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Wed, 29 Aug 2007 07:49:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/#comment-160310</guid>
		<description>Vadim, 

Actually speaking about selectivity I&#039;d like to see distribution rather than pure selectivity. 
If index has 2 values and  one of them is in 99% and other in 1%  it well may be index is a good idea to look up for second value - status field is typical type of such field.</description>
		<content:encoded><![CDATA[<p>Vadim, </p>
<p>Actually speaking about selectivity I&#8217;d like to see distribution rather than pure selectivity.<br />
If index has 2 values and  one of them is in 99% and other in 1%  it well may be index is a good idea to look up for second value &#8211; status field is typical type of such field.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/comment-page-1/#comment-160234</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Wed, 29 Aug 2007 00:06:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/#comment-160234</guid>
		<description>The main reason I keep around duplicate indexes is because the merge intersect will not use just the first key part of an index. But this also has the disadvantage that it will often use both indexes in the intersect which is a bug in my opinion.</description>
		<content:encoded><![CDATA[<p>The main reason I keep around duplicate indexes is because the merge intersect will not use just the first key part of an index. But this also has the disadvantage that it will often use both indexes in the intersect which is a bug in my opinion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vadim</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/comment-page-1/#comment-160168</link>
		<dc:creator>Vadim</dc:creator>
		<pubDate>Tue, 28 Aug 2007 17:59:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/#comment-160168</guid>
		<description>Xaprb,

What about checking selectivity of indexes ? ;)
http://www.mysqlperformanceblog.com/2007/08/28/do-you-always-need-index-on-where-column/</description>
		<content:encoded><![CDATA[<p>Xaprb,</p>
<p>What about checking selectivity of indexes ? <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<a href="http://www.mysqlperformanceblog.com/2007/08/28/do-you-always-need-index-on-where-column/" rel="nofollow">http://www.mysqlperformanceblog.com/2007/08/28/do-you-always-need-index-on-where-column/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/comment-page-1/#comment-160096</link>
		<dc:creator>Xaprb</dc:creator>
		<pubDate>Tue, 28 Aug 2007 12:14:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/redundant-index-is-not-always-bad/#comment-160096</guid>
		<description>For those who want to find duplicate indexes, check out MySQL Toolkit: http://mysqltoolkit.sourceforge.net/</description>
		<content:encoded><![CDATA[<p>For those who want to find duplicate indexes, check out MySQL Toolkit: <a href="http://mysqltoolkit.sourceforge.net/" rel="nofollow">http://mysqltoolkit.sourceforge.net/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
