<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to choose SQL column types: a case study</title>
	<link>http://www.xaprb.com/blog/2006/02/07/how-to-choose-sql-column-types/</link>
	<description>Stay curious!</description>
	<pubDate>Sun, 20 Jul 2008 22:56:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: What is SQL?</title>
		<link>http://www.xaprb.com/blog/2006/02/07/how-to-choose-sql-column-types/#comment-8188</link>
		<author>What is SQL?</author>
		<pubDate>Tue, 22 May 2007 09:18:07 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/07/how-to-choose-sql-column-types/#comment-8188</guid>
		<description>I'd appreciate some more examples, especially for MySQL and SQLite implementations. I've been googling "best practices" all day and there is very little information regarding the semantics of choosing column type, only the technical side of the story is well documented.</description>
		<content:encoded><![CDATA[<p>I&#8217;d appreciate some more examples, especially for MySQL and SQLite implementations. I&#8217;ve been googling &#8220;best practices&#8221; all day and there is very little information regarding the semantics of choosing column type, only the technical side of the story is well documented.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nik Hughes</title>
		<link>http://www.xaprb.com/blog/2006/02/07/how-to-choose-sql-column-types/#comment-796</link>
		<author>Nik Hughes</author>
		<pubDate>Wed, 24 May 2006 17:34:00 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/07/how-to-choose-sql-column-types/#comment-796</guid>
		<description>&lt;p&gt;You point up two problematic mindsets that "We Techies" need to try to overcome. While "Think Carefully" is a good moral, I think it goes beyond that. It isn't just thinking, it is being less selfish/ego-centric. Most of our work is ours for a very short time. After we are done creating it, it becomes the users' product. And the maintenance programmers' product.&lt;/p&gt;

&lt;p&gt;So in thinking, you suggest that we should ask the semantic question: "How easy will it be to understand this later?" I think it would be useful to ask other questions like:"How is the data entry clerk going to use this?" "The manager reading reports?" "How easy will it be for my successor to change/expand this in the future?" Think about all the others who will be impacted by our code.&lt;/p&gt;

&lt;p&gt;For example, I've had folks from the business side swear up and down that a particular document identifier would &lt;strong&gt;never&lt;/strong&gt; be larger than 10 characters. The first inclination is to pick the smallest column size possible. Naturally, if I believed them, I would probably pick &lt;code&gt;VARCHAR(10)&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Naturally, they lied. &lt;/p&gt;

&lt;p&gt;(Not because they are Evil or Stupid. But because the world changes, more sources of these documents get set up, and there is more complexity to model. So my First Cautionary Rule remains "The client always lies.")&lt;/p&gt;

&lt;p&gt;No problem! A quick &lt;code&gt;ALTER TABLE&lt;/code&gt; and the problem is solved, eh?&lt;/p&gt;

&lt;p&gt;Well, yes. Except that data in the database never stays there (and would be totally useless if it did.)  So we have the 600+ reports that need to be validated to make there is enough space to display additional characters. We have the data exchange files that pass this information to other organizations. We have the 3000 dynamic web pages that need to checked. For each one, it might be fine; it might be a problem. But you have to check. &lt;/p&gt;

&lt;p&gt;So now, years later, some poor maintenance programmer gets to pay for my inability to predict just how big the lie actually was.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>You point up two problematic mindsets that &#8220;We Techies&#8221; need to try to overcome. While &#8220;Think Carefully&#8221; is a good moral, I think it goes beyond that. It isn&#8217;t just thinking, it is being less selfish/ego-centric. Most of our work is ours for a very short time. After we are done creating it, it becomes the users&#8217; product. And the maintenance programmers&#8217; product.</p>
<p>So in thinking, you suggest that we should ask the semantic question: &#8220;How easy will it be to understand this later?&#8221; I think it would be useful to ask other questions like:&#8221;How is the data entry clerk going to use this?&#8221; &#8220;The manager reading reports?&#8221; &#8220;How easy will it be for my successor to change/expand this in the future?&#8221; Think about all the others who will be impacted by our code.</p>
<p>For example, I&#8217;ve had folks from the business side swear up and down that a particular document identifier would <strong>never</strong> be larger than 10 characters. The first inclination is to pick the smallest column size possible. Naturally, if I believed them, I would probably pick <code>VARCHAR(10)</code>. </p>
<p>Naturally, they lied. </p>
<p>(Not because they are Evil or Stupid. But because the world changes, more sources of these documents get set up, and there is more complexity to model. So my First Cautionary Rule remains &#8220;The client always lies.&#8221;)</p>
<p>No problem! A quick <code>ALTER TABLE</code> and the problem is solved, eh?</p>
<p>Well, yes. Except that data in the database never stays there (and would be totally useless if it did.)  So we have the 600+ reports that need to be validated to make there is enough space to display additional characters. We have the data exchange files that pass this information to other organizations. We have the 3000 dynamic web pages that need to checked. For each one, it might be fine; it might be a problem. But you have to check. </p>
<p>So now, years later, some poor maintenance programmer gets to pay for my inability to predict just how big the lie actually was.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
