<?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>InfoAdvisors&#039; Blog &#187; Oracle</title>
	<atom:link href="http://blog.infoadvisors.com/index.php/tag/oracle/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.infoadvisors.com</link>
	<description>Love Your Data - Team Data</description>
	<lastBuildDate>Thu, 02 May 2013 21:12:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Identity Column Issues and Trade-offs</title>
		<link>http://blog.infoadvisors.com/index.php/2010/12/01/identity-column-issues-and-trade-offs/</link>
		<comments>http://blog.infoadvisors.com/index.php/2010/12/01/identity-column-issues-and-trade-offs/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 16:49:00 +0000</pubDate>
		<dc:creator>Karen Lopez</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Data Modeling]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[Identity]]></category>
		<category><![CDATA[Index]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Primary Key]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Unique]]></category>

		<guid isPermaLink="false">http://blog.infoadvisors.com/index.php/2010/12/01/identity-column-issues-and-trade-offs/</guid>
		<description><![CDATA[This post is based on a post I previously blogged on 30 May 2008…but like most design apporaches, it still holds true. If you&#8217;ve heard me present, then you know [...]<div class='yarpp-related-rss yarpp-related-none'>

No related posts yet.
</div>
]]></description>
				<content:encoded><![CDATA[<p>This post is based on a post I previously blogged on 30 May 2008…but like most design apporaches, it still holds true.</p>
<p>If you&#8217;ve heard me present, then you know that one of my primary design mantras is:</p>
<h3>Everything is a trade off.&#160; You need to be able to explain, in both business and technical terms, the cost, benefits, and risks associated with every design decision.</h3>
<p>If you can&#8217;t do that, then you aren&#8217;t doing design: you are copying design patterns from other designs and hoping for the best outcome, even if your current design has different requirements and risk tolerances.</p>
<p>I am often told that a database design must have surrogate keys on every table and that &quot;right&quot; way to implement surrogate keys is to use the Identity property in SQL Server (or the RowID in Oracle, or the Identity property in DB2).&#160; These sorts of features of modern DBMSs do vary from vendor to vendor, so the cost, benefit, and risk associated with each varies by version and by vendor.&#160; Most IT pros I speak with don&#8217;t realize that.</p>
<p>Many people I speak with assume, <strong><em>incorrectly</em></strong>, that Identity Property = Surrogate Key = Primary Key= Unique Index but this is not true. It is important for database designers to understand the differences between these concepts.</p>
<p>Nigel Rivett has written a great article over at Simple-talk.com about <a href="http://www.simple-talk.com/sql/t-sql-programming/identity-columns/">SQL Server&#8217;s identity property</a> and some of the interesting &quot;features&quot; of this incrementing function:</p>
<blockquote><p>Note: An identity column is not guaranteed to be unique nor consecutive. You should always place a unique index on an identity column if your system requires uniqueness.</p>
<p>&#8230;</p>
<p>Note: The next value is the step added to the current seed; not one more than the max value in the table, or even the step from the last or maximum value.</p>
</blockquote>
<p>I&#8217;m guessing that 6+ out of 10 of experienced SQL Server designers and developers are not clear on these two gotchas.&#160; Other DBMSs have technical issues as well.&#160; When I&#8217;m questioned on why I don&#8217;t just slap on an identity property, call it a PK an move on to the next change request, I usually start asking questions:</p>
<ul>
<li>Will the application need to assume that the values are always sequential?&#160; What if the sequence is missing a few steps?&#160; Will that break the code? </li>
<li>Will the Identity column value be displayed anywhere outside the database, such as on a report or on a screen?&#160; </li>
<li>Will the users be confused if a sequence is missing or if they &quot;restart&quot; in the middle of an order? </li>
<li>Will the Identity column value be used outside this database? How?&#160; Where? </li>
<li>What are our plans for dealing with rows that exceed the maximum number of identity values (in some versions of DB2, identity values maxed out at 32k or so)?</li>
</ul>
<p>Identity properties can be useful, but as in every design decision, there are uses that are appropriate and uses that are not &#8212; it all comes down to cost, benefit, and risk.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts yet.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.infoadvisors.com/index.php/2010/12/01/identity-column-issues-and-trade-offs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
