<?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: Using MySQL Data Types</title>
	<atom:link href="http://www.tech-evangelist.com/2007/12/09/mysql-data-types/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tech-evangelist.com/2007/12/09/mysql-data-types/</link>
	<description>Technical Articles, Musings and Opinions from Tech-Evangelist</description>
	<lastBuildDate>Sun, 29 Jan 2012 19:09:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Doogie</title>
		<link>http://www.tech-evangelist.com/2007/12/09/mysql-data-types/comment-page-1/#comment-12797</link>
		<dc:creator>Doogie</dc:creator>
		<pubDate>Mon, 24 May 2010 15:34:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.tech-evangelist.com/2007/12/09/mysql-data-types/#comment-12797</guid>
		<description>Hi vynum

That&#039;s good info. The statement doesn&#039;t say anything about performance, but your points about performance are well-taken. The statement is accurate in that it is the most common form used and it does conserve disk disk space and therefore is more efficient from that perspective.  Even though disk space is cheap these days, if you have a large table you may not want to burn up space unnecessarily with columns padded with spaces.  It depends upon how variable the length of the data might be. However, if performance is a critical issue and every millisecond is important (it frequently is these days), the CHAR type looks like it has the benefits that you pointed out. 

For anyone who wants to learn more about the differences, check out the MySQL page on this topic. 

&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/char.html&quot; rel=&quot;nofollow&quot;&gt;The CHAR and VARCHAR Types&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Hi vynum</p>
<p>That&#8217;s good info. The statement doesn&#8217;t say anything about performance, but your points about performance are well-taken. The statement is accurate in that it is the most common form used and it does conserve disk disk space and therefore is more efficient from that perspective.  Even though disk space is cheap these days, if you have a large table you may not want to burn up space unnecessarily with columns padded with spaces.  It depends upon how variable the length of the data might be. However, if performance is a critical issue and every millisecond is important (it frequently is these days), the CHAR type looks like it has the benefits that you pointed out. </p>
<p>For anyone who wants to learn more about the differences, check out the MySQL page on this topic. </p>
<p><a href="http://dev.mysql.com/doc/refman/5.0/en/char.html" rel="nofollow">The CHAR and VARCHAR Types</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vynum</title>
		<link>http://www.tech-evangelist.com/2007/12/09/mysql-data-types/comment-page-1/#comment-12796</link>
		<dc:creator>vynum</dc:creator>
		<pubDate>Mon, 24 May 2010 15:05:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.tech-evangelist.com/2007/12/09/mysql-data-types/#comment-12796</guid>
		<description>varchar (x)
&quot;For most database applications, this is the most common and efficient method for storing short strings.&quot;

varchar (x)  vs char (x)

This is not necessarily all true as it may seem to an average everyday reader. &quot;efficient method&quot; in the above sentence uses two words of great meaning but unclarity.  &quot;efficient method&quot; is unclear as how the varchar command is efficient. From a MySql expert and MySql database perspective, what this means in the sentence above is limiting disk space only.

The VARCHAR&#039;s only advantage over the CHAR command is limiting disk space. VARCHAR DOES NOT  HAVE THE SPEED OF LOOKUPS AND RESULTSETS AS DOES CHAR DOES!! 

TO CONSERVE DISK SPACE USE: varchar (x)
FOR SPEED OF RETREIVING RECORDS USE:  char (x)

The only difference between the two is how the data is actually stored. You can still have &quot;variable characters&quot; in the CHAR!  It&#039;s just the reason that CHAR is so much more faster because it is padded with spaces. And under the MySqL Engine, this is a good thing. It makes insertion and retrieval much faster. Why? Its because the way MySql runs through all the rows and columns to find specific data. And, if the data is not padded in the field, such as when using the VARCHAR (x) MySql runs slower. Especially when your database grows and grows.  Most of the time when DBA&#039;s complain about why their database was fast in the beginning but slowed down after a while.  This could very well be the culprit.

So, Disk-space is enormousness now days, and CPU speeds are lighting fast. So its up to you to make the call. But from judging that disk-space is cheap, and CPU&#039;s are faster, I banking on CHAR over VARCHAR to be the winner. 


But in today&#039;s world of 2010, and how disk-space is very cheap, I would highly recommend using CHAR inplace of varchar.  On a database of millions of records, the look-up and retrieval up records overwhelmingly faster.</description>
		<content:encoded><![CDATA[<p>varchar (x)<br />
&#8220;For most database applications, this is the most common and efficient method for storing short strings.&#8221;</p>
<p>varchar (x)  vs char (x)</p>
<p>This is not necessarily all true as it may seem to an average everyday reader. &#8220;efficient method&#8221; in the above sentence uses two words of great meaning but unclarity.  &#8220;efficient method&#8221; is unclear as how the varchar command is efficient. From a MySql expert and MySql database perspective, what this means in the sentence above is limiting disk space only.</p>
<p>The VARCHAR&#8217;s only advantage over the CHAR command is limiting disk space. VARCHAR DOES NOT  HAVE THE SPEED OF LOOKUPS AND RESULTSETS AS DOES CHAR DOES!! </p>
<p>TO CONSERVE DISK SPACE USE: varchar (x)<br />
FOR SPEED OF RETREIVING RECORDS USE:  char (x)</p>
<p>The only difference between the two is how the data is actually stored. You can still have &#8220;variable characters&#8221; in the CHAR!  It&#8217;s just the reason that CHAR is so much more faster because it is padded with spaces. And under the MySqL Engine, this is a good thing. It makes insertion and retrieval much faster. Why? Its because the way MySql runs through all the rows and columns to find specific data. And, if the data is not padded in the field, such as when using the VARCHAR (x) MySql runs slower. Especially when your database grows and grows.  Most of the time when DBA&#8217;s complain about why their database was fast in the beginning but slowed down after a while.  This could very well be the culprit.</p>
<p>So, Disk-space is enormousness now days, and CPU speeds are lighting fast. So its up to you to make the call. But from judging that disk-space is cheap, and CPU&#8217;s are faster, I banking on CHAR over VARCHAR to be the winner. </p>
<p>But in today&#8217;s world of 2010, and how disk-space is very cheap, I would highly recommend using CHAR inplace of varchar.  On a database of millions of records, the look-up and retrieval up records overwhelmingly faster.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JeffS</title>
		<link>http://www.tech-evangelist.com/2007/12/09/mysql-data-types/comment-page-1/#comment-10764</link>
		<dc:creator>JeffS</dc:creator>
		<pubDate>Tue, 07 Apr 2009 21:15:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.tech-evangelist.com/2007/12/09/mysql-data-types/#comment-10764</guid>
		<description>Thank you so much, I wish this was the first article I found when searching for an overview of the data types... because it was by far the best I&#039;ve seen!  Thanks Again!</description>
		<content:encoded><![CDATA[<p>Thank you so much, I wish this was the first article I found when searching for an overview of the data types&#8230; because it was by far the best I&#8217;ve seen!  Thanks Again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomasW</title>
		<link>http://www.tech-evangelist.com/2007/12/09/mysql-data-types/comment-page-1/#comment-10176</link>
		<dc:creator>TomasW</dc:creator>
		<pubDate>Fri, 19 Dec 2008 15:12:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.tech-evangelist.com/2007/12/09/mysql-data-types/#comment-10176</guid>
		<description>Thank you for a great article. I&#039;m working on a project where accurate precision is needed.

If a double in general is accurate down to 15 decimal places, is a field defined as double(14,5) or double(20,15) accurate down to 5 resp. 15 decimals? Do I need to maximize the D part of the double(M,D) definition in order to get accurate numbers?</description>
		<content:encoded><![CDATA[<p>Thank you for a great article. I&#8217;m working on a project where accurate precision is needed.</p>
<p>If a double in general is accurate down to 15 decimal places, is a field defined as double(14,5) or double(20,15) accurate down to 5 resp. 15 decimals? Do I need to maximize the D part of the double(M,D) definition in order to get accurate numbers?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

