<?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: Enum Fields VS Varchar VS Int + Joined table: What is Faster?</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/</link>
	<description>Percona&#039;s MySQL &#38; InnoDB performance and scalability blog</description>
	<lastBuildDate>Sat, 11 Feb 2012 16:45:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Wil Moore III</title>
		<link>http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/comment-page-1/#comment-876722</link>
		<dc:creator>Wil Moore III</dc:creator>
		<pubDate>Tue, 17 Jan 2012 07:50:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/#comment-876722</guid>
		<description>Sorry,

Actually, the indexes start @ 1 (0 signifies there was a data validation error). How is that for tricky :)</description>
		<content:encoded><![CDATA[<p>Sorry,</p>
<p>Actually, the indexes start @ 1 (0 signifies there was a data validation error). How is that for tricky <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wil Moore III</title>
		<link>http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/comment-page-1/#comment-876718</link>
		<dc:creator>Wil Moore III</dc:creator>
		<pubDate>Tue, 17 Jan 2012 07:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/#comment-876718</guid>
		<description>@Praveena,

The length of the ENUM value doesn&#039;t matter much (unless you are approaching the table definition limit)...the ENUM &quot;index&quot; is what is stored.

In other words, if you were to insert a value into an ENUM column, but instead of the actual value, insert the index (for instance, 0 for the first item, or 1 for the second item), you would notice that once you&#039;ve viewed the table, you would see the expected value listed.

This is great for performance; however, it can lead to some very subtle bugs if you aren&#039;t aware of what is actually going on.</description>
		<content:encoded><![CDATA[<p>@Praveena,</p>
<p>The length of the ENUM value doesn&#8217;t matter much (unless you are approaching the table definition limit)&#8230;the ENUM &#8220;index&#8221; is what is stored.</p>
<p>In other words, if you were to insert a value into an ENUM column, but instead of the actual value, insert the index (for instance, 0 for the first item, or 1 for the second item), you would notice that once you&#8217;ve viewed the table, you would see the expected value listed.</p>
<p>This is great for performance; however, it can lead to some very subtle bugs if you aren&#8217;t aware of what is actually going on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praveena</title>
		<link>http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/comment-page-1/#comment-793150</link>
		<dc:creator>Praveena</dc:creator>
		<pubDate>Sun, 09 Jan 2011 18:52:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/#comment-793150</guid>
		<description>What is the maximum recommended length of a ENUM?</description>
		<content:encoded><![CDATA[<p>What is the maximum recommended length of a ENUM?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tadas Sasnauskas</title>
		<link>http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/comment-page-1/#comment-741568</link>
		<dc:creator>Tadas Sasnauskas</dc:creator>
		<pubDate>Tue, 30 Mar 2010 15:47:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/#comment-741568</guid>
		<description>VARCHAR is nightmare when database/code is not documented. In case of enum you at least know possible value set.</description>
		<content:encoded><![CDATA[<p>VARCHAR is nightmare when database/code is not documented. In case of enum you at least know possible value set.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Farrukh</title>
		<link>http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/comment-page-1/#comment-624098</link>
		<dc:creator>Farrukh</dc:creator>
		<pubDate>Tue, 04 Aug 2009 18:54:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/#comment-624098</guid>
		<description>In the test you used int+join table, what if we move the join table functionality to our application and just compare ENUM VS CHAR VS INT.</description>
		<content:encoded><![CDATA[<p>In the test you used int+join table, what if we move the join table functionality to our application and just compare ENUM VS CHAR VS INT.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: praca</title>
		<link>http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/comment-page-1/#comment-492290</link>
		<dc:creator>praca</dc:creator>
		<pubDate>Sat, 28 Feb 2009 15:07:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/#comment-492290</guid>
		<description>I use tinyint(1) to present value 0 or 1.
I thing enum, boolean and others methods works slower.</description>
		<content:encoded><![CDATA[<p>I use tinyint(1) to present value 0 or 1.<br />
I thing enum, boolean and others methods works slower.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Little surprises &#171; Arien&#8217;s Blog</title>
		<link>http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/comment-page-1/#comment-483661</link>
		<dc:creator>Little surprises &#171; Arien&#8217;s Blog</dc:creator>
		<pubDate>Sat, 21 Feb 2009 00:11:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/#comment-483661</guid>
		<description>[...] about it, but after that session I was looking up some VARCHAR vs CHAR debate information and found this post on the MySQL Performance Blog. Turns out his idea isn&#8217;t really that crazy (performance-wise, at [...]</description>
		<content:encoded><![CDATA[<p>[...] about it, but after that session I was looking up some VARCHAR vs CHAR debate information and found this post on the MySQL Performance Blog. Turns out his idea isn&#8217;t really that crazy (performance-wise, at [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ÐŸÐ¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ðµ ÑÐ¿Ð¸ÑÐºÐ° Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ñ‹Ñ… Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ð¹ Ð¿Ð¾Ð»Ñ ENUM &#124; Ð—Ð°Ð¿Ð¸ÑÐºÐ¸ MySQL Ð´ÐµÐ²ÐµÐ»Ð¾Ð¿ÐµÑ€Ð°</title>
		<link>http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/comment-page-1/#comment-449160</link>
		<dc:creator>ÐŸÐ¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ðµ ÑÐ¿Ð¸ÑÐºÐ° Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ñ‹Ñ… Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ð¹ Ð¿Ð¾Ð»Ñ ENUM &#124; Ð—Ð°Ð¿Ð¸ÑÐºÐ¸ MySQL Ð´ÐµÐ²ÐµÐ»Ð¾Ð¿ÐµÑ€Ð°</dc:creator>
		<pubDate>Tue, 20 Jan 2009 07:32:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/#comment-449160</guid>
		<description>[...] Ð˜Ð½Ñ‚ÐµÑ€ÐµÑÐ½Ð°Ñ ÑÑ‚Ð°Ñ‚ÑŒÑ Ð¾ Ð¿Ñ€Ð¾Ð¸Ð·Ð²Ð¾Ð´Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾ÑÑ‚Ð¸ Ð¿Ð¾Ð»ÐµÐ¹ Ñ‚Ð¸Ð¿Ð° [...]</description>
		<content:encoded><![CDATA[<p>[...] Ð˜Ð½Ñ‚ÐµÑ€ÐµÑÐ½Ð°Ñ ÑÑ‚Ð°Ñ‚ÑŒÑ Ð¾ Ð¿Ñ€Ð¾Ð¸Ð·Ð²Ð¾Ð´Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾ÑÑ‚Ð¸ Ð¿Ð¾Ð»ÐµÐ¹ Ñ‚Ð¸Ð¿Ð° [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: somebody</title>
		<link>http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/comment-page-1/#comment-324239</link>
		<dc:creator>somebody</dc:creator>
		<pubDate>Mon, 07 Jul 2008 15:59:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/#comment-324239</guid>
		<description>have you guys tried indexing state_id on the cities_join table.
though I read something about frequent inserts with indexes being slow.
but would indexing speed things up?

and also

SELECT SQL_NO_CACHE c.city FROM states s LEFT JOIN cities_join c ON (s.id = c.state_id) WHERE s.name=&#039;Minnesota&#039; LIMIT 10000,5;

since your searching by state maybe if you place it at the left mysql would search for that first and then search for the cities with similar state_id, and it will be ordered automatically.

ENUM is what got me to this blog, but since you guys said its dangerous, it&#039;s no longer in my options.</description>
		<content:encoded><![CDATA[<p>have you guys tried indexing state_id on the cities_join table.<br />
though I read something about frequent inserts with indexes being slow.<br />
but would indexing speed things up?</p>
<p>and also</p>
<p>SELECT SQL_NO_CACHE c.city FROM states s LEFT JOIN cities_join c ON (s.id = c.state_id) WHERE s.name=&#8217;Minnesota&#8217; LIMIT 10000,5;</p>
<p>since your searching by state maybe if you place it at the left mysql would search for that first and then search for the cities with similar state_id, and it will be ordered automatically.</p>
<p>ENUM is what got me to this blog, but since you guys said its dangerous, it&#8217;s no longer in my options.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hakan</title>
		<link>http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/comment-page-1/#comment-312410</link>
		<dc:creator>Hakan</dc:creator>
		<pubDate>Wed, 11 Jun 2008 14:26:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/01/24/enum-fields-vs-varchar-vs-int-joined-table-what-is-faster/#comment-312410</guid>
		<description>Thanks for the test. 

I think using the 4th way depends on the application. On our case, we store this kind of information in TINYINT and do the work in application, as we only select 25 of them at once. But when selecting thousands of row, and making change in all of them may not be better than storing in ENUM or varchar. I&#039;ll do some tests about this when I have time and post here.</description>
		<content:encoded><![CDATA[<p>Thanks for the test. </p>
<p>I think using the 4th way depends on the application. On our case, we store this kind of information in TINYINT and do the work in application, as we only select 25 of them at once. But when selecting thousands of row, and making change in all of them may not be better than storing in ENUM or varchar. I&#8217;ll do some tests about this when I have time and post here.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

