<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog - ShiftEleven &#187; performance</title>
	<atom:link href="http://shifteleven.com/articles/tag/performance/feed" rel="self" type="application/rss+xml" />
	<link>http://shifteleven.com</link>
	<description></description>
	<lastBuildDate>Mon, 09 Jan 2012 04:04:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Making ActiveRecord faster by NOT indexing</title>
		<link>http://shifteleven.com/articles/2008/04/29/making-activerecord-faster-by-not-indexing?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=making-activerecord-faster-by-not-indexing</link>
		<comments>http://shifteleven.com/articles/2008/04/29/making-activerecord-faster-by-not-indexing#comments</comments>
		<pubDate>Tue, 29 Apr 2008 16:55:14 +0000</pubDate>
		<dc:creator>K. Adam Christensen</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[indexing]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[singletableinheritance]]></category>

		<guid isPermaLink="false">http://shifteleven.com/?p=64</guid>
		<description><![CDATA[Usually one of the first things I read about on how to speed up ActiveRecord is to index my columns to speed up the lookup of items. &#8220;Of course!&#8221; But could indexing too much be harmful Essentially, if your column &#8230; <a href="http://shifteleven.com/articles/2008/04/29/making-activerecord-faster-by-not-indexing">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Usually one of the first things I read about on how to speed up ActiveRecord is to index my columns to speed up the lookup of items.  &#8220;Of course!&#8221;  <a href="http://www.mysqlperformanceblog.com/2007/08/28/do-you-always-need-index-on-where-column/?">But could indexing too much be harmful</a></p>
<p>Essentially, if your column is an enum, then indexing it could actually cause MySQL to do more work.  Why?  Because the data set is so large, the MySQL ends up doing a full scan.  So things like keeping track if something is active (1 or 0) then you can expect indexing to hurt.</p>
<p>So how does this effect ActiveRecord?  Well, if you&#8217;re keeping track of whether a user is active or not you would not want to index that column alone.  Nor would you want to index a <code>type</code> column if you were using single table inheritance, again, because there isn&#8217;t a lot of variance in the type.</p>
<p>So make sure that you index the right things, like IDs and leave the enum-like columns alone.</p>
]]></content:encoded>
			<wfw:commentRss>http://shifteleven.com/articles/2008/04/29/making-activerecord-faster-by-not-indexing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

