<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>What did you learn today? - SQL</title>
    <link>http://blog.philknows.net/</link>
    <description>Phil Denoncourt's Technology Rants</description>
    <language>en-us</language>
    <copyright>Phil Denoncourt III</copyright>
    <lastBuildDate>Sat, 05 Jun 2010 17:34:28 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>phil@denoncourtassociates.com</managingEditor>
    <webMaster>phil@denoncourtassociates.com</webMaster>
    <item>
      <trackback:ping>http://blog.philknows.net/Trackback.aspx?guid=1b0b5535-b8e3-4af5-af29-285e52991644</trackback:ping>
      <pingback:server>http://blog.philknows.net/pingback.aspx</pingback:server>
      <pingback:target>http://blog.philknows.net/PermaLink,guid,1b0b5535-b8e3-4af5-af29-285e52991644.aspx</pingback:target>
      <dc:creator>Phil Denoncourt</dc:creator>
      <wfw:comment>http://blog.philknows.net/CommentView,guid,1b0b5535-b8e3-4af5-af29-285e52991644.aspx</wfw:comment>
      <wfw:commentRss>http://blog.philknows.net/SyndicationService.asmx/GetEntryCommentsRss?guid=1b0b5535-b8e3-4af5-af29-285e52991644</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Here’s the slides and scripts from the talk I gave today at #nhcc2 (New Hampshire
Code Camp II). If you’re interested in the databases, send me an email. They’re multi-gig,
so we’ll have to figure out the best way to get them to you.
</p>
        <a href="http://blog.philknows.net/content/binary/SQL and XML.zip">SQL and XML.zip
(61.53 KB)</a>
        <img width="0" height="0" src="http://blog.philknows.net/aggbug.ashx?id=1b0b5535-b8e3-4af5-af29-285e52991644" />
      </body>
      <title>SQL and XML &amp;ndash; Slides and Demo Scripts</title>
      <guid isPermaLink="false">http://blog.philknows.net/PermaLink,guid,1b0b5535-b8e3-4af5-af29-285e52991644.aspx</guid>
      <link>http://blog.philknows.net/PermaLink,guid,1b0b5535-b8e3-4af5-af29-285e52991644.aspx</link>
      <pubDate>Sat, 05 Jun 2010 17:34:28 GMT</pubDate>
      <description>&lt;p&gt;
Here’s the slides and scripts from the talk I gave today at #nhcc2 (New Hampshire
Code Camp II). If you’re interested in the databases, send me an email. They’re multi-gig,
so we’ll have to figure out the best way to get them to you.
&lt;/p&gt;
&lt;a href="http://blog.philknows.net/content/binary/SQL and XML.zip"&gt;SQL and XML.zip
(61.53 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://blog.philknows.net/aggbug.ashx?id=1b0b5535-b8e3-4af5-af29-285e52991644" /&gt;</description>
      <comments>http://blog.philknows.net/CommentView,guid,1b0b5535-b8e3-4af5-af29-285e52991644.aspx</comments>
      <category>Speaking Engagements</category>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://blog.philknows.net/Trackback.aspx?guid=49db5acf-a7d6-4c64-8727-50213033e338</trackback:ping>
      <pingback:server>http://blog.philknows.net/pingback.aspx</pingback:server>
      <pingback:target>http://blog.philknows.net/PermaLink,guid,49db5acf-a7d6-4c64-8727-50213033e338.aspx</pingback:target>
      <dc:creator>Phil Denoncourt</dc:creator>
      <wfw:comment>http://blog.philknows.net/CommentView,guid,49db5acf-a7d6-4c64-8727-50213033e338.aspx</wfw:comment>
      <wfw:commentRss>http://blog.philknows.net/SyndicationService.asmx/GetEntryCommentsRss?guid=49db5acf-a7d6-4c64-8727-50213033e338</wfw:commentRss>
      <title>Reviewing Databases</title>
      <guid isPermaLink="false">http://blog.philknows.net/PermaLink,guid,49db5acf-a7d6-4c64-8727-50213033e338.aspx</guid>
      <link>http://blog.philknows.net/PermaLink,guid,49db5acf-a7d6-4c64-8727-50213033e338.aspx</link>
      <pubDate>Wed, 21 Mar 2007 15:59:42 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;There is plenty of guidance on reviewing code.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;(Look
at CodeFrisk.Com/Guidance.aspx for some links).&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;I’ve
found that &lt;u&gt;the&lt;/u&gt; one absolutely most critical piece of a traditional application
never undergoes any type of review.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Most
applications live and die by their database, and yet it rarely gets reviewed.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;If
you’re lucky (although you might not think so), you’ll have a DBA check things over,
but they are mostly concerned with performance.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Maintainability
and adherence to standards are not at the top of their list.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;I’ve listed some of the things I look at when I review a database:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;-Appropriate Normalization&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;It’s tough to say what is and isn’t appropriate normalization.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;You’ll
know it when you see it.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;Stuff
like having a separate table for the 
&lt;st1:country-region w:st="on"&gt;
&lt;st1:place w:st="on"&gt;US&lt;/st1:place&gt;
&lt;/st1:country-region&gt;
states or one called Gender is usually a red flag of having gone too far.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Conversely,
having the same field in multiple tables is usually a sign that normalization hasn’t
gone far enough.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;--Is all access through stored procedures&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;Most development shops have a policy that says, “All data access
shall be done through stored procedures”.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;If
you have that policy, check to make sure this is being adhered to.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;An
easy way to check this is to deny access to the tables and allow access to the stored
procedures.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;--Look for premature optimization&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;I’ve seen times when developers are using Join hints or locking
hints in their query.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;“If I force the
query to use a merge join, it goes 5x faster”.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Meaning
it goes 5 times faster on the development box which has far fewer rows and 3 fewer
processors than the production machine.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Once
it goes the to production machine, there’s a good chance that SQL will decide upon
a different plan to execute the statement, making the hint destructive on the production
machine&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;--Are objects secured and scripted&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;Eventually, when you roll the database into a production environment,
access to the database will (or should) be locked down.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Is
the development environment the same?&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Are
the scripts that you have under source control (you do have the database creation
scripts under source control don’t you?)&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;include
securing of the object.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;--Are updates applied in the same order&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;I can think of no better way to create an application that suffers
from chronic &lt;/font&gt;&lt;a href="http://www.sql-server-performance.com/deadlocks.asp"&gt;&lt;font color=#800080&gt;deadlock&lt;/font&gt;&lt;/a&gt;&lt;font color=#000000&gt; situations
than to have one stored procedure update tables A, B, &amp;amp; C (in that order) and
have another stored procedure update tables C, B, &amp;amp; A (in that order).&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Updates
should always be applied in the same order.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Otherwise,
you’re increasing the chance that a row in A will be locked by one stored proc while
waiting for a row in table C locked by the other stored proc.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Generally
the order is enforced naturally because you have to respect foreign keys, but every
now and then I come across this.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;--Biblical stored procedures&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;By biblical, I mean volume, not divinely inspired.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I’m
referring to stored procedures that use up more than one printer cartridge if you
were to print it.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Nowadays when you see
a large stored procedure, it’s one of two things:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;1) Embedded business logic – This seems to be a remnant of client
server programming where you were forced to put your business logic in the stored
procedure.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;It’s arguable about whether
or the database is the best place to keep your business logic.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Most
people (including me) believe it’s not.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Business
logic should be kept in a business logic component that validates, enforces and calculates.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;2) Poorly defined schema.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Most
validations that you see taking place in stored procs could be controlled by using
schema constructs like check constraints, triggers, foreign keys and defaults.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Put
that type of information in the schema where it can be enforced consistently everywhere
rather than burdening the stored procedure.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;--Does the Development database match what’s in source control&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;To reinforce this, database schema objects need to be kept under
source control.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Having a database backup
plan isn’t sufficient.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Putting the objects
in source control allow you to manage changes and releases much more effectively.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Otherwise
you’ll be struggling to determine which objects have changed in the development database
and need to be deployed, and figuring out who added a field to table.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Keeping
the schema under source control used to be a very manual process, but now tools like &lt;/font&gt;&lt;a href="http://msdn2.microsoft.com/en-us/teamsystem/aa718764.aspx"&gt;&lt;font color=#800080&gt;Visual
Studio for Database Professionals&lt;/font&gt;&lt;/a&gt;&lt;font color=#000000&gt; make this painless.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;--Cloned stored procedures / Views.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;This is very common.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;When
you need data, most developers don’t look to see if there is an existing stored procedure
or view that satisfies their needs.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;They’ll
create a brand new one.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Then you end
up with a database that has 3 different stored procedures that get a customer record
by its ID.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Now all these duplicated procs
have to be maintained.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Best prevention
for this is to have a strict naming convention for your procedures.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;Those are some of the quick patterns I look for when reviewing
a database.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;What are the kind of things
that stand out when you look over a database?&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;i style="mso-bidi-font-style: normal"&gt;&lt;font color=#000000&gt;Wouldn’t you feel comfortable
having your code reviewed by an expert?&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Go
to &lt;/font&gt;&lt;a href="http://www.codefrisk.com/"&gt;&lt;font color=#800080&gt;CodeFrisk.com&lt;/font&gt;&lt;/a&gt;&lt;font color=#000000&gt; to
see how I can proofread your code at a reasonable price.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.philknows.net/aggbug.ashx?id=49db5acf-a7d6-4c64-8727-50213033e338" /&gt;</description>
      <comments>http://blog.philknows.net/CommentView,guid,49db5acf-a7d6-4c64-8727-50213033e338.aspx</comments>
      <category>Development</category>
      <category>SQL</category>
      <category>Code Reviews</category>
    </item>
    <item>
      <trackback:ping>http://blog.philknows.net/Trackback.aspx?guid=2c97bd0a-4459-4afa-aeb3-15cc50182d04</trackback:ping>
      <pingback:server>http://blog.philknows.net/pingback.aspx</pingback:server>
      <pingback:target>http://blog.philknows.net/PermaLink,guid,2c97bd0a-4459-4afa-aeb3-15cc50182d04.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://blog.philknows.net/CommentView,guid,2c97bd0a-4459-4afa-aeb3-15cc50182d04.aspx</wfw:comment>
      <wfw:commentRss>http://blog.philknows.net/SyndicationService.asmx/GetEntryCommentsRss?guid=2c97bd0a-4459-4afa-aeb3-15cc50182d04</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <span style="FONT-FAMILY: Verdana">For the past month, I've been focusing on getting
up to speed on the data mining features of SQL 2005. Really amazing stuff. I'll be
giving a presentation on this in the near future. One of the things that took a significant
amount of time was putting together a database that I could use for testing. I didn't
want to use AdventureWorks or something like that because I wanted something that
had more data and more "real world". </span>
        </p>
        <p>
          <span style="FONT-FAMILY: Verdana">So I downloaded the past 20 years of stock prices
from a public quote server, the past 10 years of foreign currency prices, and a slew
of economical data from <a href="http://www.federalreserve.gov/">Federal Reserve</a>.
(See picture below). The database has over 7,300 companies (I tried to get all NASDAQ,
NYSE, and AMEX tickers) with over 16 million quotes. </span>
        </p>
        <p>
          <span style="FONT-FAMILY: Verdana">Now I'm creating models and running predictions.
For the most part, I'm able to exercise all of the data mining algorithms. I haven't
found the secret formula to the stock market yet, but someday… </span>
        </p>
        <p>
          <span style="FONT-FAMILY: Verdana">If anybody else is interested getting a copy of
this database, let me know via the contact link. Because it's over a gigabyte in size
and I don't have massive bandwidth allowances in my hosting account, it has to be
transported via postal mail. PayPal me $30 to cover the cost of burning a DVD and
sending it, and I'll get it out to you. </span>
        </p>
        <p>
        </p>
        <img src="http://blog.denoncourtassociates.com/content/binary/ButtonwoodSchemaSmaller.jpg" border="0" />
        <img width="0" height="0" src="http://blog.philknows.net/aggbug.ashx?id=2c97bd0a-4459-4afa-aeb3-15cc50182d04" />
      </body>
      <title>Sample Databases</title>
      <guid isPermaLink="false">http://blog.philknows.net/PermaLink,guid,2c97bd0a-4459-4afa-aeb3-15cc50182d04.aspx</guid>
      <link>http://blog.philknows.net/PermaLink,guid,2c97bd0a-4459-4afa-aeb3-15cc50182d04.aspx</link>
      <pubDate>Sun, 19 Nov 2006 15:45:32 GMT</pubDate>
      <description>&lt;p&gt;
&lt;span style="FONT-FAMILY: Verdana"&gt;For the past month, I've been focusing on getting
up to speed on the data mining features of SQL 2005. Really amazing stuff. I'll be
giving a presentation on this in the near future. One of the things that took a significant
amount of time was putting together a database that I could use for testing. I didn't
want to use AdventureWorks or something like that because I wanted something that
had more data and more "real world". &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-FAMILY: Verdana"&gt;So I downloaded the past 20 years of stock prices
from a public quote server, the past 10 years of foreign currency prices, and a slew
of economical data from &lt;a href="http://www.federalreserve.gov/"&gt;Federal Reserve&lt;/a&gt;.
(See picture below). The database has over 7,300 companies (I tried to get all NASDAQ,
NYSE, and AMEX tickers) with over 16 million quotes. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-FAMILY: Verdana"&gt;Now I'm creating models and running predictions.
For the most part, I'm able to exercise all of the data mining algorithms. I haven't
found the secret formula to the stock market yet, but someday… &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-FAMILY: Verdana"&gt;If anybody else is interested getting a copy of
this database, let me know via the contact link. Because it's over a gigabyte in size
and I don't have massive bandwidth allowances in my hosting account, it has to be
transported via postal mail. PayPal me $30 to cover the cost of burning a DVD and
sending it, and I'll get it out to you. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://blog.denoncourtassociates.com/content/binary/ButtonwoodSchemaSmaller.jpg" border=0&gt;&lt;img width="0" height="0" src="http://blog.philknows.net/aggbug.ashx?id=2c97bd0a-4459-4afa-aeb3-15cc50182d04" /&gt;</description>
      <comments>http://blog.philknows.net/CommentView,guid,2c97bd0a-4459-4afa-aeb3-15cc50182d04.aspx</comments>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://blog.philknows.net/Trackback.aspx?guid=84277003-f7cf-4309-9bb7-5b6b53dd4fe5</trackback:ping>
      <pingback:server>http://blog.philknows.net/pingback.aspx</pingback:server>
      <pingback:target>http://blog.philknows.net/PermaLink,guid,84277003-f7cf-4309-9bb7-5b6b53dd4fe5.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://blog.philknows.net/CommentView,guid,84277003-f7cf-4309-9bb7-5b6b53dd4fe5.aspx</wfw:comment>
      <wfw:commentRss>http://blog.philknows.net/SyndicationService.asmx/GetEntryCommentsRss?guid=84277003-f7cf-4309-9bb7-5b6b53dd4fe5</wfw:commentRss>
      <title>Tables with GUIDs as keys are just as fast as tables with ints</title>
      <guid isPermaLink="false">http://blog.philknows.net/PermaLink,guid,84277003-f7cf-4309-9bb7-5b6b53dd4fe5.aspx</guid>
      <link>http://blog.philknows.net/PermaLink,guid,84277003-f7cf-4309-9bb7-5b6b53dd4fe5.aspx</link>
      <pubDate>Wed, 13 Sep 2006 21:51:55 GMT</pubDate>
      <description>&lt;p&gt;
I was sitting in this meeting in which I was only peripherally involved and there's
only so much doodling you can do.&amp;nbsp; So I did what most other people in the meeting
were doing, I started daydreaming.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
I'm a big fan of GUIDs, but there's all this noise about how slow they are because
they're bigger than an int making for inefficient searching.&amp;nbsp; So I started to
wonder, how much slower are GUIDs than ints? So I started to do the math, and for
a table with 4 billion rows, I was coming out with only one more logical read if the
key was a GUID than an int.... I know.. Didn't make sense to me.&amp;nbsp; So I put it
to a practical test.
&lt;/p&gt;
&lt;p&gt;
I created two tables.&amp;nbsp; One called IntWithData and the other called GuidWithData.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.denoncourtassociates.com/content/binary/intTable.jpg" border=0&gt;&lt;img src="http://blog.denoncourtassociates.com/content/binary/guidTable.jpg" border=0&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
I then populated them with a million rows.&amp;nbsp; --As a side note, I started the scripts
to populate the tables at about the same time, and they finished at the same time.&amp;nbsp;
Something I think I will research further is how much slower it is to insert a record
in a GUID table compared to an INT table.&amp;nbsp; Common sense tells you it's supposed
be way slower to populate a GUID--
&lt;/p&gt;
&lt;p&gt;
I took a look at the statistics for the index by using the following statements: 
&lt;br&gt;
&lt;font color=#0000ff size=2&gt;&lt;font color=#0000ff size=2&gt;SELECT&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#808080 size=2&gt;*&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;FROM&lt;/font&gt;&lt;font color=#000000 size=2&gt; sys.dm_db_index_physical_stats&lt;/font&gt;&lt;font color=#808080 size=2&gt;(&lt;/font&gt;&lt;font color=#ff00ff size=2&gt;db_id&lt;/font&gt;&lt;font color=#808080 size=2&gt;(),&lt;/font&gt;&lt;font color=#ff00ff size=2&gt;object_id&lt;/font&gt;&lt;font color=#808080 size=2&gt;(&lt;/font&gt;&lt;font color=#ff0000 size=2&gt;'dbo.GuidWithData'&lt;/font&gt;&lt;font color=#808080 size=2&gt;),null,null,&lt;/font&gt;&lt;font color=#ff0000 size=2&gt;'DETAILED'&lt;/font&gt;&lt;font color=#808080 size=2&gt;)&lt;br&gt;
&lt;/font&gt;&lt;font color=#0000ff size=2&gt;SELECT&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#808080 size=2&gt;*&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;FROM&lt;/font&gt;&lt;font color=#000000 size=2&gt; sys.dm_db_index_physical_stats&lt;/font&gt;&lt;font color=#808080 size=2&gt;(&lt;/font&gt;&lt;font color=#ff00ff size=2&gt;db_id&lt;/font&gt;&lt;font color=#808080 size=2&gt;(),&lt;/font&gt;&lt;font color=#ff00ff size=2&gt;object_id&lt;/font&gt;&lt;font color=#808080 size=2&gt;(&lt;/font&gt;&lt;font color=#ff0000 size=2&gt;'dbo.IntWithData'&lt;/font&gt;&lt;font color=#808080 size=2&gt;),null,null,&lt;/font&gt;&lt;font color=#ff0000 size=2&gt;'DETAILED'&lt;/font&gt;&lt;font color=#808080 size=2&gt;)&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
That produced these results:
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#0000ff size=2&gt;&lt;font color=#808080 size=2&gt; 
&lt;table style="WIDTH: 1018pt; BORDER-COLLAPSE: collapse" cellspacing=0 cellpadding=0 width=1357 border=1 x:str&gt;
&lt;colgroup&gt;
&lt;col style="WIDTH: 48pt" width=64&gt;
&lt;col style="WIDTH: 58pt; mso-width-source: userset; mso-width-alt: 2816" width=77&gt;
&lt;col style="WIDTH: 48pt" span=19 width=64&gt;
&lt;tbody&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=64 height=17&gt;
&lt;font face=Arial color=#000000 size=2&gt;database_id&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 58pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=77&gt;
&lt;font face=Arial color=#000000 size=2&gt;object_id&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;index_id&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;partition_number&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;index_type_desc&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;alloc_unit_type_desc&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;index_depth&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;index_level&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;avg_fragmentation_in_percent&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;fragment_count&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;avg_fragment_size_in_pages&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;page_count&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;avg_page_space_used_in_percent&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;record_count&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;ghost_record_count&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;version_ghost_record_count&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;min_record_size_in_bytes&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;max_record_size_in_bytes&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;avg_record_size_in_bytes&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 96pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent; mso-ignore: colspan" width=128 colspan=2&gt;
&lt;font face=Arial color=#000000 size=2&gt;forwarded_record_count&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" align=right height=17 x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;6&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="2105058535"&gt;
&lt;font face=Arial color=#000000 size=2&gt;2105058535&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;CLUSTERED&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;INDEX&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;IN_ROW_DATA&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="99.036999493157595"&gt;
&lt;font face=Arial color=#000000 size=2&gt;99.037&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;5919&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;5919&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="68.856770447244898"&gt;
&lt;font face=Arial color=#000000 size=2&gt;68.85677&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1000000&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;31&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;31&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;31&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;NULL&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" align=right height=17 x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;6&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="2105058535"&gt;
&lt;font face=Arial color=#000000 size=2&gt;2105058535&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;CLUSTERED&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;INDEX&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;IN_ROW_DATA&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="96.296296296296305"&gt;
&lt;font face=Arial color=#000000 size=2&gt;96.2963&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;27&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;27&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="67.686632073140601"&gt;
&lt;font face=Arial color=#000000 size=2&gt;67.68663&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;5919&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;23&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;23&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;23&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;NULL&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" align=right height=17 x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;6&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="2105058535"&gt;
&lt;font face=Arial color=#000000 size=2&gt;2105058535&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;CLUSTERED&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;INDEX&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;IN_ROW_DATA&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;2&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="8.3148010872250993"&gt;
&lt;font face=Arial color=#000000 size=2&gt;8.314801&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;27&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;23&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;23&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;23&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;NULL&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;
&gt;&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;table style="WIDTH: 1018pt; BORDER-COLLAPSE: collapse" cellspacing=0 cellpadding=0 width=1357 border=1 x:str&gt;
&lt;colgroup&gt;
&lt;col style="WIDTH: 48pt" width=64&gt;
&lt;col style="WIDTH: 58pt; mso-width-source: userset; mso-width-alt: 2816" width=77&gt;
&lt;col style="WIDTH: 48pt" span=19 width=64&gt;
&lt;tbody&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=64 height=17&gt;
&lt;font face=Arial color=#000000 size=2&gt;database_id&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 58pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=77&gt;
&lt;font face=Arial color=#000000 size=2&gt;object_id&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;index_id&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;partition_number&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;index_type_desc&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;alloc_unit_type_desc&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;index_depth&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;index_level&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;avg_fragmentation_in_percent&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;fragment_count&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;avg_fragment_size_in_pages&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;page_count&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;avg_page_space_used_in_percent&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;record_count&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;ghost_record_count&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;version_ghost_record_count&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;min_record_size_in_bytes&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;max_record_size_in_bytes&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64&gt;
&lt;font face=Arial color=#000000 size=2&gt;avg_record_size_in_bytes&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 96pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent; mso-ignore: colspan" width=128 colspan=2&gt;
&lt;font face=Arial color=#000000 size=2&gt;forwarded_record_count&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" align=right height=17 x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;6&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="2073058421"&gt;
&lt;font face=Arial color=#000000 size=2&gt;2073058421&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;CLUSTERED&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;INDEX&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;IN_ROW_DATA&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="0.423402617397998"&gt;
&lt;font face=Arial color=#000000 size=2&gt;0.423403&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;317&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="8.1955835962145098"&gt;
&lt;font face=Arial color=#000000 size=2&gt;8.195584&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;2598&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="99.841129231529493"&gt;
&lt;font face=Arial color=#000000 size=2&gt;99.84113&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1000000&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;19&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;19&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;19&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;NULL&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" align=right height=17 x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;6&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="2073058421"&gt;
&lt;font face=Arial color=#000000 size=2&gt;2073058421&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;CLUSTERED&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;INDEX&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;IN_ROW_DATA&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;9&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;9&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="46.338855942673597"&gt;
&lt;font face=Arial color=#000000 size=2&gt;46.33886&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;2598&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;11&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;11&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;11&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;NULL&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" align=right height=17 x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;6&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="2073058421"&gt;
&lt;font face=Arial color=#000000 size=2&gt;2073058421&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;CLUSTERED&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;INDEX&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;IN_ROW_DATA&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;2&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num="1.4208055349641699"&gt;
&lt;font face=Arial color=#000000 size=2&gt;1.420806&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;9&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;11&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;11&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align=right x:num&gt;
&lt;font face=Arial color=#000000 size=2&gt;11&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"&gt;
&lt;font face=Arial color=#000000 size=2&gt;NULL&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;
This is tough to read, but what you should be getting out of this is: Guid table is &lt;strong&gt;very &lt;/strong&gt;fragmented.&amp;nbsp;
Int table is not.&amp;nbsp; Also the Guid table had about 2.25 more pages than the Int
table.&amp;nbsp; Ideally you would be running an overnight process that reorganized pages
in your DB, and that would help with the fragmentation.
&lt;/p&gt;
&lt;p&gt;
So now the test query.&amp;nbsp; The question I wanted to answer was:&amp;nbsp; How many logical
reads are needed to read a record out of the Int table and how many are needed to
read out of the Guid table?
&lt;/p&gt;
&lt;font color=#0000ff size=2&gt; 
&lt;p&gt;
SET
&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;STATISTICS&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;IO&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;ON&gt;
&lt;p&gt;
SELECT 
&lt;/font&gt;&lt;font color=#808080 size=2&gt;*&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;FROM&lt;/font&gt;&lt;font size=2&gt;&lt;font color=#000000&gt; IntWithData &lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;WHERE&lt;/font&gt;&lt;font color=#000000 size=2&gt; ID &lt;/font&gt;&lt;font color=#808080 size=2&gt;=&lt;/font&gt;&lt;font size=2&gt;&lt;font color=#000000&gt; 619284&lt;/font&gt;&gt;
&lt;/font&gt;&lt;font color=#0000ff size=2&gt; 
&lt;p&gt;
SELECT
&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#808080 size=2&gt;*&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;FROM&lt;/font&gt;&lt;font size=2&gt;&lt;font color=#000000&gt; GuidWithData&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;WHERE&lt;/font&gt;&lt;font color=#000000 size=2&gt; ID &lt;/font&gt;&lt;font color=#808080 size=2&gt;=&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;'7DD78950-D3CD-4016-8D92-738A6E0666F2'&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#008000 size=2&gt;--
I had to find this value in my data&lt;/font&gt;&gt;
&lt;p&gt;
&lt;font color=#008000 size=2&gt;&lt;font color=#003300&gt;The results:&lt;br&gt;
....&lt;/font&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;&lt;font color=#003300&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;&lt;font size=1&gt;(1 row(s) affected)
&lt;/p&gt;
&lt;p&gt;
Table 'IntWithData'. Scan count 0, logical reads 3, physical reads 0, read-ahead reads
0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
&lt;/p&gt;
&lt;p&gt;
(1 row(s) affected)
&lt;/p&gt;
&lt;p&gt;
Table 'GuidWithData'. Scan count 0, logical reads 3, physical reads 0, read-ahead
reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000 size=2&gt;3 logical reads. That means in a table with 1 million rows,
there should be &lt;strong&gt;no difference&lt;/strong&gt; between a table with Guid as a key
and one that has an int.&amp;nbsp; This is because the records are searched for using
a binary search algorithm.&amp;nbsp; In a perfectly balanced tree, it shouldn't take the
algorithm more than 20 tries to find the key with many of those "tries" are contained
in the same index page.&amp;nbsp; At some volume, and I haven't calculated exactly where,
there will be a difference of one logical read, but that's it.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000 size=2&gt;Hopefully, I haven't misinterpreted the results of this
test.&amp;nbsp; I don't think I have.&amp;nbsp; The bottom line is that Guids take up more
physical space, but you're able to find them just as fast as ints.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000 size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&gt;&gt;&lt;img width="0" height="0" src="http://blog.philknows.net/aggbug.ashx?id=84277003-f7cf-4309-9bb7-5b6b53dd4fe5" /&gt;</description>
      <comments>http://blog.philknows.net/CommentView,guid,84277003-f7cf-4309-9bb7-5b6b53dd4fe5.aspx</comments>
      <category>Development</category>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://blog.philknows.net/Trackback.aspx?guid=a1ab7bdb-72d3-4e0e-addf-33d7f2257832</trackback:ping>
      <pingback:server>http://blog.philknows.net/pingback.aspx</pingback:server>
      <pingback:target>http://blog.philknows.net/PermaLink,guid,a1ab7bdb-72d3-4e0e-addf-33d7f2257832.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://blog.philknows.net/CommentView,guid,a1ab7bdb-72d3-4e0e-addf-33d7f2257832.aspx</wfw:comment>
      <wfw:commentRss>http://blog.philknows.net/SyndicationService.asmx/GetEntryCommentsRss?guid=a1ab7bdb-72d3-4e0e-addf-33d7f2257832</wfw:commentRss>
      <title>Cool new features I found in SQL 2005</title>
      <guid isPermaLink="false">http://blog.philknows.net/PermaLink,guid,a1ab7bdb-72d3-4e0e-addf-33d7f2257832.aspx</guid>
      <link>http://blog.philknows.net/PermaLink,guid,a1ab7bdb-72d3-4e0e-addf-33d7f2257832.aspx</link>
      <pubDate>Fri, 18 Aug 2006 21:01:27 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;I was preparing for
the SQL Server Exam 70-441 (Designing Database Solutions by Using Microsoft® SQL Server™
2005) and I kept coming across a whole bunch of small features that you don’t hear
a lot about.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I’m not talking about the
big ones everyone already knows about like CLR Integration, DDL triggers, XML, and
ranking functions.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;These are ones that
took me by pleasant surprise.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;I
think they’re really cool, so I wanted to point them out.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;u&gt;&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;Included
Columns / Covering Indexes&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;Say you had a critical/oft-used
report that ran a statement like:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;SELECT&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Name&lt;/span&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt; ProductNumber&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;FROM&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; Production&lt;/font&gt;&lt;span style="COLOR: gray"&gt;.&lt;/span&gt;&lt;font color=#000000&gt;Product&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;WHERE&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; Style&lt;/font&gt;&lt;span style="COLOR: gray"&gt;=&lt;/span&gt;&lt;span style="COLOR: red"&gt;'U'&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: gray"&gt;AND&lt;/span&gt;&lt;font color=#000000&gt; Class&lt;/font&gt;&lt;span style="COLOR: gray"&gt;=&lt;/span&gt;&lt;span style="COLOR: red"&gt;'L'&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;If you wanted to put
an index on the table to speed things up, you’d put an index on Style, Class, Name,
and ProductNumber. &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;That would remove
the need to go from the index page to the table page to get all the information for
the query.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;SQL 2005 has added the include
clause to the Create Index statement.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;CREATE&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;INDEX&lt;/span&gt;&lt;font color=#000000&gt; IX_Product_Class_Style&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ON&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; Production&lt;/font&gt;&lt;span style="COLOR: gray"&gt;.&lt;/span&gt;&lt;font color=#000000&gt;Product &lt;/font&gt;&lt;span style="COLOR: gray"&gt;(&lt;/span&gt;&lt;font color=#000000&gt;Class&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;Style&lt;/font&gt;&lt;span style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;INCLUDE&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: gray"&gt;(&lt;/span&gt;&lt;font color=#000000&gt;Name&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt; ProductNumber&lt;/font&gt;&lt;span style="COLOR: gray"&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;What this is doing is
indexing just the Class and Style fields of the table.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The
Name and ProductNumber are stored at the leaf nodes of the index.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This
saves space in the index pages, meaning you can get more rows in an index page, reducing
I/O and Disk Space.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;u&gt;&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;Dynamic
Management Views&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;Seriously, these are
pretty cool.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Really.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;If
you haven’t looked at these, take the time to play around with a few.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;With these new views,
you are able to get high visibility into the SQL Server engine.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Wondering
what’s about to be written to the disk?&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Query
sys.dm_io_pending_io_requests.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Troubleshooting
execution plans?&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Use sys.dm_exec_cached_plans
and sys.dm_exec_plan_attributes.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Need
to see what’s running on the server right now?&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;sys.dm_os_tasks.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;How
often is an index used?&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;There’s sys.dm_db_index_usage_stats
that will answer that question.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;There
are over 80 views that provide very useful information when you are troubleshooting
problems or just curious as to how SQL Server organizes itself.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;u&gt;&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;span style="TEXT-DECORATION: none"&gt;&lt;font size=3&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;
&lt;/o:p&gt;
&lt;/span&gt;&lt;/u&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;u&gt;&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;sp_create_plan_guide&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;Every now and then,
I have a query that runs like a jackrabbit on my development machine, but runs like
3 legged turtle on a production machine.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This
is usually because it decided not to use an index on the production machine due to
differences in data density or because running the query with parallelism is slower
with some statements.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;To troubleshoot
these situations, I end up modifying the stored procedure to add various hints.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;Rather than modify the
stored procedure, you can specify a hint for an existing query plan using the sp_create_plan_guide
stored proc.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This way you can experiment
without modifying the stored procedure and the hint doesn’t become part of your codebase.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;MSDN
documentation can be found &lt;/font&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms179880.aspx"&gt;&lt;font size=3&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font size=3&gt;.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;u&gt;&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;OUTPUT
Clause&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;A lot of people already
know about this pretty cool feature, but I didn’t.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;In
the past, if you do an insert to a table, and the table has an identity column, after
the insert, you would look at &lt;/span&gt;&lt;span style="COLOR: fuchsia; FONT-FAMILY: Verdana"&gt;@@IDENTITY&lt;/span&gt;&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt; or &lt;/span&gt;&lt;span style="COLOR: fuchsia; FONT-FAMILY: Verdana"&gt;scope_identity()&lt;/span&gt;&lt;span style="FONT-FAMILY: Verdana"&gt;&lt;font color=#000000&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;That
always seemed hackish to me.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;You can now add
an OUTPUT clause to the end of an INSERT, UPDATE, or DELETE statement.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;That
will return the rows changed by the statement.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;INSERT&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;INTO&lt;/span&gt;&lt;font color=#000000&gt; Person&lt;/font&gt;&lt;span style="COLOR: gray"&gt;.&lt;/span&gt;&lt;font color=#000000&gt;Address&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: gray"&gt;(&lt;/span&gt;&lt;font color=#000000&gt;AddressLine1&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;AddressLine2&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;City&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;StateProvinceID&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;PostalCode&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;rowguid&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;ModifiedDate&lt;/font&gt;&lt;span style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;VALUES&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;(&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;@AddressLine1&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;@AddressLine2&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;@City&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;@StateProvinceID&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;@PostalCode&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;@rowguid&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;@ModifiedDate&lt;/font&gt;&lt;span style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;OUTPUT&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; INSERTED&lt;/font&gt;&lt;span style="COLOR: gray"&gt;.&lt;/span&gt;&lt;font color=#000000&gt;AddressID&lt;/font&gt;&lt;span style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;You use the pseudo
tables INSERTED and DELETED, just like in triggers.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;u&gt;&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;Storing
BLOBs in Table page&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;Inevitability, on each
project I work on, there is a requirement to have a field capable of storing more
than 8k in a table.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;It’s usually a field
that the user can enter unlimited comments about a customer.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;So
I define it as a text field.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I always
feel guilty about it because the user’s text will rarely be more than 100 bytes and
I know it’s going to be stored on a different page.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;
&lt;font size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;In SQL 2005, if the
data will fit in the same page as the rest of the record, it will place it in the
same page.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This works with varchar/varbinary/nvarchar(max)
and XML datatypes.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The behavior is described &lt;/font&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms189087.aspx"&gt;&lt;font size=3&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font size=3&gt; at
MSDN.&lt;/font&gt;&lt;u&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font size=3&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Persistence of Computed Columns&lt;/b&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/u&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;This is kind of neat.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;We’ve
had the ability to define computed columns in tables for a while.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;They
worked exactly as they’re named.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;When
the column was needed, it was computed.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Now
the results of the computed column can be saved to disk.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This
allows you to index computed columns.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;You
can also feel free to create calculated columns that can be computationally intense.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;CREATE&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;TABLE&lt;/span&gt;&lt;font color=#000000&gt; LineItem &lt;/font&gt;&lt;span style="COLOR: gray"&gt;(&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;LineItemID &lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;IDENTITY&lt;/span&gt;&lt;span style="COLOR: gray"&gt;(&lt;/span&gt;&lt;font color=#000000&gt;1&lt;/font&gt;&lt;span style="COLOR: gray"&gt;,&lt;/span&gt;&lt;font color=#000000&gt;1&lt;/font&gt;&lt;span style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;OrderID &lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;span style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ItemDesc &lt;/font&gt;&lt;span style="COLOR: blue"&gt;varchar&lt;/span&gt;&lt;span style="COLOR: gray"&gt;(&lt;/span&gt;&lt;font color=#000000&gt;512&lt;/font&gt;&lt;span style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Qty &lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;span style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Cost &lt;/font&gt;&lt;span style="COLOR: blue"&gt;money&lt;/span&gt;&lt;span style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;LineTotal &lt;/font&gt;&lt;span style="COLOR: blue"&gt;as&lt;/span&gt;&lt;font color=#000000&gt; Qty &lt;/font&gt;&lt;span style="COLOR: gray"&gt;*&lt;/span&gt;&lt;font color=#000000&gt; Cost &lt;/font&gt;&lt;span style="COLOR: blue"&gt;PERSISTED&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;&lt;font size=3&gt;Those are all the ones
I found.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;What you have noticed as small
new features in SQL that make life easier?&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.philknows.net/aggbug.ashx?id=a1ab7bdb-72d3-4e0e-addf-33d7f2257832" /&gt;</description>
      <comments>http://blog.philknows.net/CommentView,guid,a1ab7bdb-72d3-4e0e-addf-33d7f2257832.aspx</comments>
      <category>Development</category>
      <category>SQL</category>
    </item>
  </channel>
</rss>