﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server 2005 Performance Tuning  / FK selection (an nvarchar(30) column or four int columns) / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 18:41:42 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: FK selection (an nvarchar(30) column or four int columns)</title><link>http://www.sqlservercentral.com/Forums/Topic942479-360-1.aspx</link><description>Yes the default clustered index is on all 4 ints.  I suspect this will be faster as stated.  Thanks for the replies.</description><pubDate>Tue, 29 Jun 2010 10:00:33 GMT</pubDate><dc:creator>Eric.Johns</dc:creator></item><item><title>RE: FK selection (an nvarchar(30) column or four int columns)</title><link>http://www.sqlservercentral.com/Forums/Topic942479-360-1.aspx</link><description>Of course the best answer you'll get is "It Depends..."  but anyway, How is the table indexed?  If the default indexing (clustered on all four ints) is used, I'd expect using them as your fk would be your best bet.  The reality is it's going to depend on the specifics of your data, and what your query patterns look like.</description><pubDate>Tue, 29 Jun 2010 09:57:44 GMT</pubDate><dc:creator>weitzera</dc:creator></item><item><title>RE: FK selection (an nvarchar(30) column or four int columns)</title><link>http://www.sqlservercentral.com/Forums/Topic942479-360-1.aspx</link><description>[quote][b]Eric.Johns (6/24/2010)[/b][hr] What would be the best thing to do, query performance wise, as far as a FK in my new table, using the 4 int columns or the nvarchar(30) as an FK?[/quote] i would go with stefan but still for concrete results, test it with large volume data.</description><pubDate>Fri, 25 Jun 2010 06:30:07 GMT</pubDate><dc:creator>Bhuvnesh</dc:creator></item><item><title>RE: FK selection (an nvarchar(30) column or four int columns)</title><link>http://www.sqlservercentral.com/Forums/Topic942479-360-1.aspx</link><description>It will probably not make much difference regarding performance.I expect the four int columns to be slightly faster.</description><pubDate>Thu, 24 Jun 2010 08:42:49 GMT</pubDate><dc:creator>Stefan_G</dc:creator></item><item><title>FK selection (an nvarchar(30) column or four int columns)</title><link>http://www.sqlservercentral.com/Forums/Topic942479-360-1.aspx</link><description>To make a long story short, I have to add a new table with an FK to an existing table.  The existing table has a PK made up of 4 int columns (the largest value in any one of these is 4 digits), there is also an nvarchar(30) column in this table that is always unique.  What would be the best thing to do, query performance wise, as far as a FK in my new table, using the 4 int columns or the nvarchar(30) as an FK?</description><pubDate>Thu, 24 Jun 2010 08:22:38 GMT</pubDate><dc:creator>Eric.Johns</dc:creator></item></channel></rss>