{"id":663,"date":"2005-08-31T05:41:00","date_gmt":"2005-08-31T05:41:00","guid":{"rendered":"\/blogs\/kimberly\/post\/MSDN-Webcast-QA-A-Primer-to-Proper-SQL-Server-Development-Part-4-of-10-.aspx"},"modified":"2013-01-11T23:13:46","modified_gmt":"2013-01-12T07:13:46","slug":"msdn-webcast-qa-a-primer-to-proper-sql-server-development-part-4-of-10","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/msdn-webcast-qa-a-primer-to-proper-sql-server-development-part-4-of-10\/","title":{"rendered":"MSDN Webcast Q&#038;A: A Primer to Proper SQL Server Development, Part 4 of 10"},"content":{"rendered":"<p><strong><span style=\"font-size: 16pt; color: navy\"><font face=\"Times New Roman\">Effectively Designing a Scalable and Reliable Database <\/span><\/strong><strong><font face=\"Times New Roman\"><em><span style=\"font-size: 14pt; color: navy\">A Primer to Proper SQL Server Development<br \/>\n<\/span><\/em><span style=\"color: navy\">Indexing Best Practices, Part 4 of 10<\/span><\/strong><font face=\"Times New Roman\"><strong><em><span style=\"font-size: 11pt; color: navy\">Presented by<\/span><\/em><\/strong><strong><span style=\"font-size: 11pt; color: navy\"> Kimberly L. Tripp, SQLskills.com<\/span><\/strong><strong><span style=\"font-size: 16pt; color: navy\"><font face=\"Times New Roman\">&nbsp;<\/span><\/strong><span style=\"font-size: 11pt\"><font color=\"#000000\"><font face=\"Times New Roman\">For a list of the non-technical Resources related to this webcast, please review the following blog entry:<\/span><strong><span style=\"font-size: 11pt\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/kimberly\/msdn-webcast-qa-for-resources-indexing-best-practices-part-4-of-10\/\"><font face=\"Times New Roman\">MSDN Webcast Q&amp;A for Resources: Indexing Best Practices, Part 4 of 10 <\/a><\/span><\/strong><span style=\"font-size: 11pt\"><\/span><strong><span style=\"font-size: 16pt; color: navy\"><font face=\"Times New Roman\">&nbsp;<\/span><\/strong><strong><span style=\"font-size: 16pt\"><font color=\"#000000\"><font face=\"Times New Roman\">Technical Questions<\/span><\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\" class=\"MsoNormal\">\n<font color=\"#000000\"><font face=\"Times New Roman\"><strong>Q: When a clustered index is added to a table what happens physically to the data pages? <\/strong>SQL Server moves the data to the new location defined by the ON clause of the index creation statement. The ON clause can specify a different filegroup or even a partition scheme and the heap will move to the new location.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q: I&#39;m not getting the follow-up emails with the replay link. How do I get on this email list for replay?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">You *must* register through MSDN. If you are using a partner site then that is probably why you&rsquo;re not getting the email. IF you are registering through MSDN and still not receiving the email, please contact <a href=\"mailto:eventsup@microsoft.com\"><font face=\"Times New Roman\" size=\"3\">eventsup@microsoft.com<\/a><font face=\"Times New Roman\" size=\"3\" color=\"#000000\"> with your information.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>Does the copy affect the transaction log?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Yes. A create index or rebuild index statement does require the statement to be a single transaction. If you are running with your database set to the FULL recovery model then this single transaction will create a lot of log activity. You could switch to the BULK_LOGGED or SIMPLE recovery model and get less log activity but switching to the SIMPLE recovery model should be avoided as it will break the continuity of the transaction log. I would recommend two resources to get more information about Recovery Models and their impact on performance, logging and recovery.\n<\/p>\n<p style=\"margin-left: 0.5in\">\n<a href=\"https:\/\/www.sqlskills.com\/blogs\/kimberly\/msdn-webcast-qa-a-primer-to-proper-sql-server-development-part-2-of-10\/\"><font face=\"Times New Roman\" size=\"3\">MSDN Webcast Q&amp;A: A Primer to Proper SQL Server Development, Creating a Reliable and Automated Backup Strategy, Part 2 of 10<\/a>\n<\/p>\n<p><font face=\"Times New Roman\"><font color=\"#000000\">Review the sample chapter:<span class=\"content1\"><span style=\"font-size: 8.5pt; font-family: 'Times New Roman'\"> <\/span><\/span><span class=\"content1\"><span style=\"font-family: 'Times New Roman'\"><a href=\"https:\/\/www.sqlskills.com\/resources\/sqlserverhachapter9.pdf\" target=\"_blank\">Chapter 9: Database Environment Basics for Recovery<\/a><font size=\"3\" color=\"#000000\"> from the MSPress title:<\/span><\/span><span class=\"content1\"><span style=\"font-size: 8.5pt; font-family: 'Times New Roman'\"><font color=\"#000000\"> <a href=\"http:\/\/www.microsoft.com\/learning\/en\/us\/book.aspx?ID=6515&amp;locale=en-us\" target=\"_blank\"><span style=\"font-size: 12pt\">Microsoft SQL Server 2000 High Availability<\/span><\/a><\/span><\/span><font color=\"#000000\"><font face=\"Times New Roman\"><strong>Q: <\/strong><strong>Can one switch back and forth between simple and full recovery mode? <\/strong><\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Ideally, you would switch ONLY between the FULL Recovery model and BULK_LOGGED Recovery model but not with SIMPLE. The two resources listed above will also help to clarify this point.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q: What about re-building a clustered index? Will it be that slow too? Is it recommended to do it off-hours?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Rebuilding a clustered index takes a lot of the same requirements that creating the CL index does. It can also be slow and yes &ndash; as a result, you might want to do this off hours. You can speed up the process by changing recovery models but switching recovery models can also have an impact on recovery. See the two resources above for more details to help clarify this point. And, in part 5, I&rsquo;ll cover more of the fragmentation details.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<font color=\"#000000\"><font face=\"Times New Roman\"><strong>Q: <\/strong><strong>When is it desirable to move a table?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">This is not necessarily an easy one to answer simply. But, I often recommend separating transaction processing data from read-only data as well as possibly placing a large table on its own filegroup (especially true with partitioned objects). But, I don&rsquo;t often recommend separating indexes. Here&rsquo;s a link to a SQL Server Magazine article I wrote &ndash; it does give some guidance. In general I don&rsquo;t separate too many objects. However, if you&rsquo;re building a database that you will put into a read-only state you might want to work a bit harder to &ldquo;shift&rdquo; objects to filegroups in such a way that each of those objects gets a nice and clean and contiguous chunk of space within the file. Another time that it&rsquo;s useful to &ldquo;move&rdquo; an object is when you load data into a heap and then want to build the clustered index on another filegroup &ndash; where that heap will become a partition of a partitioned table. This is good when the clustered index will move the object into a filegroup that does not have other objects in it. Again, the clustered index will be nice and clean and contiguous in the destination filegroup.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<font color=\"#000000\"><font face=\"Times New Roman\"><strong>Q: <\/strong><strong>So, if I understand correctly&hellip; a good approach to creating a table would be to have a clustered index independent of the primary key. So, ideally you could use a GUID for the PK and then have a clustered index in order to minimize the fragmentation.<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">The most ideal combination is when the clustered index is on an identity column &ndash; and even better if this is the Primary Key. However, if you do want to keep a GUID as the primary key then yes, you can create a clustered index which is independent of the primary key.\n<\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<span><font face=\"Times New Roman\" size=\"3\" color=\"#000000\"><\/span>\n<\/p>\n<p><strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>In general, do you think folks have more problems setting up indexes for OLTP, OLAP\/DWH, or Web apps?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">In general, I think Decision Support environments can have more indexes with less of a negative&hellip; OLTP is a bit harder to find the right balance. The hardest is combination environments&hellip;\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<font color=\"#000000\"><font face=\"Times New Roman\"><strong>Q: <\/strong><strong>What was the diff between 0 and 1 on the third argument of DBCC IND?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">The third parameter is for Index ID. 0 = Heap, 1 = Clustered Index, 2-250 are non-clustered index ids.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>Should we keep the install defaults like Collation, and others? Or do you have recommendations?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Generally speaking, yes &ndash; I would recommend keeping the defaults. However, I do recommend that some development environments &ndash; especially those who are producing software for sale. When the database can be installed\/setup on other servers that may have different code pages, etc., you might want to use binary case-sensitive sort. This will make your application more consistent &ndash; even with case-sensitive servers&hellip;and you never know if one of your customers may have one! It will also help to make you a better coder.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<font color=\"#000000\"><font face=\"Times New Roman\"><strong>Q: <\/strong><strong>What design considerations should I take into account when planning my primary keys, indexes and clustered indexes for databases that will be used with replication?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">There are no specific requirements for Replication other than the fact that you must have a Primary Key&hellip; but the same best practices discussed today apply and should be used in replication as well.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>I am using SQL Server 2000. I have a table that is used a lot on the web server. The scan density is 97%. Should I adjust the indexing and\/or Primary Key?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">I tend to think more about how fast it drops rather than the actual number. But &ndash; 97% is pretty good in general. What you might want to do is a rebuild IF you have off hours time to rebuild (in SQL Server 2000 rebuilding can be done offline ONLY). Otherwise, you might just want to setup a defrag procedure. However, this is NOT\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q: Why are so many SQL commands undocumented and how do you get to know how to use them if they are undocumented?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">First and foremost, I want to strongly urge you to take your time with commands that are undocumented. If the commands are really useful for day-to-day operations, they&rsquo;re probably already documented. Occasionally, development teams add additional functionality during development to test their functionality. These commands &ndash; while proving useful in some cases &ndash; do not generally go through the same quality assurance procedures that fully documented commands go through and as a result, I would be very cautious before using most undocumented commands.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp; <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Having said all of that, you&rsquo;ll find a lot of useful tidbits in articles, on webcasts, in books, etc.<span>&nbsp; <\/span>Just make sure you test the command thoroughly and don&rsquo;t expect to get support on it. In general, undocumented commands are NOT supported.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: W<\/span>hat is the command for scan density on SQL Server 2000?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">DBCC SHOWCONTIG. If you&rsquo;re interested in learning more about defragmentation on SQL Server 2000, please review this MSDN Webcast: <a href=\"https:\/\/msevents.microsoft.com\/cui\/Error.aspx?culture=en-US&amp;ErrorMsgID=ErrorMessage.EventDoesNotExist&amp;EventID=\"><font face=\"Times New Roman\" size=\"3\">SQL Server 2000 Performance Tuning: Index Defragmentation Best Practices<\/a>\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>In SQL Server 2000, DBCC SHOWCONTIG, can you explain extent scan fragmentation and if we should pay attention to it?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">We&rsquo;re going to go over this more with our next session on Index Defrag but Extent Scan Fragmentation describes whether or not the extents that an object owns are &ldquo;next&rdquo; to each other. If there are gaps then this implies that there are other objects &ldquo;interleaved&rdquo; with this one. This is not ideal, defragmenting the object will help to improve scans and should.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q: The size of the database doubles when a clustered index is added?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Once the index is created the space needed to build the index is released. However, while the index is <em>being<\/em> created you need roughly 2-3 times the TABLE size to build it. If you have a table which is 1GB then you should plan for at least 2-3GB of free space in order to build or rebuild a clustered index. However, it&rsquo;s only the table&rsquo;s size that doubles and it&rsquo;s only <em>during<\/em> the index creation NOT after the index has been created.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>Aren&#39;t GUIDs too large to use for an efficient index?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">No, an index can be useful even if it&rsquo;s a large percentage of the size of the table &ndash; mostly, because of the order of the columns and the criteria used in the query. Hard to give a fast answer to this but in general 16 bytes isn&rsquo;t so bad &ndash; much larger may even be acceptable.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<font color=\"#000000\"><font face=\"Times New Roman\"><strong>Q: <\/strong><strong>Does level 1 of a clustered index point to rows, or does it describe the minimum and maximum row on a page?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Basically, it&rsquo;s a pointer to the <strong>page<\/strong> and it has a pointer to the lowest value on the page. Each pointer in the non-leaf always points to the &ldquo;first&rdquo; value on the page (meaning the lowest).\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp; <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font color=\"#000000\"><font face=\"Times New Roman\"><strong>Q<span>: <\/span>Why would you be inserting using an index other than using the primary key? <\/strong>Assuming the primary key is appropriate, I wouldn&rsquo;t. However, there are a lot of environments where the primary key is chosen and kept &ndash; for a variety of reasons. SQL Server creates the clustered index on the Primary Key by default but it is not required&rsquo; you can create the clustered index on something else. It&rsquo;s the clustered index which defines the insert order &ndash; not the Primary Key; however, they are often one and the same.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>Should all indexes be clustered if unique? Would this increase performance on search results from SP?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">I think the question should really be should all clustered indexes be unique. Generally, the answer to this is yes. But to answer the second part &ndash; would this increase performance on an SP &ndash; the answer here is not necessarily. Stored procedures have many reasons for being &ndash; or not being &ndash; optimal. Plan choice, optimization and recompilation issues all play a major factor in whether or not a stored procedure is optimal. However, in session 7, I will talk about plan caching and stored procedure optimizations!\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>If there is no natural clustering key, what is the advantage of &quot;coming up with one&quot;. Or, said another way, what is the basic reason why I want a cluster rather than a heap?<\/strong><span><font color=\"#000000\"><font face=\"Times New Roman\">A heap does not inherently have order to it (that&rsquo;s the point) but when the records are not ordered then SQL Server needs to find a location in which to insert the row. This causes a lookup in something called a PFS (page free space) as well as a lookup in the table&rsquo;s Allocation Map (actually called an Index Allocation Map in SQL Server 2000 and a Heap or B-Tree Map in SQL Server 2005). To help the insert performance you generally want to have the insert location defined. However, just having a clustered index is not the best answer as there are other internal dependencies on the log. Because of these internal dependencies you typically want the clustered index to be unique, narrow and static. <\/span><span><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<\/span><span><font color=\"#000000\"><font face=\"Times New Roman\">If you&rsquo;re interested in reading more about the reasons behind having a clustered index which is unique, narrow and static:<\/span><strong><span style=\"font-size: 8.5pt\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/kimberly\/permalink.aspx?guid=bdaee3f7-1e15-414b-b75f-a290db645159\"><span style=\"font-weight: normal\"><font face=\"Times New Roman\">Ever-increasing clustering key &#8211; the Clustered Index Debate&#8230;&#8230;&#8230;.again!<\/span><\/a><font color=\"#000000\"><font face=\"Times New Roman\"> <\/span><\/strong><strong><span style=\"font-size: 8.5pt\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/kimberly\/permalink.aspx?guid=21d4683b-c28a-4adf-90cb-6df6645e5260\"><span style=\"font-weight: normal\"><font face=\"Times New Roman\">MSDN Webcast Q&amp;A: Index Defrag Best Practices &#8211; Clustering Key Choice<\/span><\/a><\/span><\/strong><span><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<\/span><span><font color=\"#000000\"><font face=\"Times New Roman\">In some cases this means adding a column to a table solely for the purposes of clustering on it.<\/span><span><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<\/span><font color=\"#000000\"><font face=\"Times New Roman\"><strong>Q: <\/strong><strong>Is it a good practice to just have non-clustered indexes?<\/strong><span><font color=\"#000000\"><font face=\"Times New Roman\">Well, that&rsquo;s a different way of answering the prior question&hellip;and while heaps can be useful for high performance loading they are generally not as useful for day to day OLTP or combination OLTP\/DSS tables. So, my recommendation is almost always &ndash; the RIGHT clustered index + additional supporting non-clustered indexes.<\/span><span><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<\/span><font color=\"#000000\"><font face=\"Times New Roman\"><strong>Q: <\/strong><strong>In large OLTP databases is it recommended to move reporting to a separate database which has a lot of non-clustered indexes and no clustered indexes?<\/strong><span><font color=\"#000000\"><font face=\"Times New Roman\">No&hellip; Again, it&rsquo;s not really a binary thing (should you always have a clustered, or not always have a clustered). Really, there are cases for both BUT in most databases &ndash; even DSS (Decision Support System) &ndash; a clustered index helps to define a narrow and unique value that all indexes have in common. This can help other operations&hellip; <span>&nbsp;<\/span>So, even in a DSS environment I generally recommend a clustered, as well as additional supporting non-clustered.<\/span><span><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<\/span><span><font color=\"#000000\"><font face=\"Times New Roman\">Having said that there are cases where a single clustered &ndash; setup for order by and range queries can be useful but that&rsquo;s generally only when the large majority of queries all want * (all columns) and you typically want the exact search and order by in almost every case.<\/span><span><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<\/span><strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>I&#39;ve read that you shouldn&#39;t cluster a column that is an Identity column because it hurts performance for OLTP as all writes are on same page\/area of disk? Your thoughts?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">There are some cases where insert performance can be compromised &ndash; in very high volume OLTP systems (typically more than 400 inserts per second but this can vary) but in general, inserting into the same &ldquo;hot&rdquo; spot of a table improves performance because the activity is isolated and the needed pages are already in cache. Lots more on this on in other Q&amp;As.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>If I add an identity column to my table to have a good clustered key, it will never be used in a query. Would I naturally also include the primary key, even though it would make the clustered key less narrow?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">You don&rsquo;t need to include the primary key is the clustered key is already unique, narrow, static and ever-increasing.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>Does this mean that vertical partitioning of a table is only helpful when the table is scanned?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font color=\"#000000\"><font face=\"Times New Roman\"><span>No, there are still many benefits in vertical partitioning &ndash; such as with locking, scanning. <\/span>I&rsquo;d refer you to review the Webcast that was part 3 in this series, for more details.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp; <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<strong><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Q<span>: <\/span>Can you use DTA against SQL 2000 databases? <\/strong>\n<\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Yes. You can use either the DTA or the ITW against SQL Server 2000. If you&#39;re looking for details about how to use the SQL Server 2000 Index Tuning Wizard you can review this whitepaper: <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/dnsql2k\/html\/itwforsql.asp\"><font face=\"Times New Roman\" size=\"3\">Index Tuning Wizard for Microsoft SQL Server 2000<\/a><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q: Is DTA in the Express version, too?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">DTA does not come with the Express Edition but you can certainly do tuning on a higher version and then use that tuned database in Express.\n<\/p>\n<p><strong><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<\/strong><font color=\"#000000\"><font face=\"Times New Roman\"><strong>Q: <\/strong><strong>Can you explain briefly Index View?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">It&rsquo;s a materialized view &ndash; in the sense that the data as defined by the view &ndash; is actually materialized and stored on disk. This has both pro&rsquo;s and con&rsquo;s and needs to be evaluated fully before you implement these. Please check out these whitepapers for more details:\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<span class=\"headingtext\"><span style=\"color: black\"><a href=\"\/blogs\/kimberly\/ct.ashx?id=1de5cfcc-493d-4874-aed4-7fb330f9eaf7&amp;url=http%3a\/\/www.microsoft.com\/technet\/prodtechnol\/sql\/2005\/impprfiv.mspx\" class=\"broken_link\"><font face=\"Times New Roman\" size=\"3\">Improving Performance with SQL Server 2005 Indexed Views<\/a><font face=\"Times New Roman\" size=\"3\"> by Author: Eric Hanson and Contributors: Gail Erickson, Lubor Kollar, Jason Ward<\/span><\/span><span style=\"color: black\"><\/span><span class=\"headingtext\"><span style=\"color: black\"><a href=\"\/blogs\/kimberly\/ct.ashx?id=1de5cfcc-493d-4874-aed4-7fb330f9eaf7&amp;url=http%3a\/\/www.microsoft.com\/technet\/prodtechnol\/sql\/2000\/maintain\/indexvw.mspx\" class=\"broken_link\"><font face=\"Times New Roman\" size=\"3\">Improving Performance with SQL Server 2000 Indexed Views<\/a><font face=\"Times New Roman\" size=\"3\"> by Author: Gail Erickson and Contributors: Lubor Kollar, Jason Ward contributor<\/span><\/span><span style=\"color: black\"><\/span><span><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<\/span><strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>Do you think one can become expert in SQL Server and other aspects of Design\/Programming or does one need to specialize?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Wow, I think it this is a tough question; more than anything I would recommend learning all of the options available so that you can better architect the right solution. Once you think you have a good solution, then move forward to really learn that area\/topic\/features. I&rsquo;ve been using a phrase with SQL Server 2005 a lot &ndash; Jack of all trades, master of <em>some<\/em>&#8230;\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>Can you repeat the new function INCLUDE on index?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">In SQL Server 2000 the maximum size of an index key is 900 bytes or 16 columns &ndash; whichever comes first. This key helps to keep an index&rsquo;s b-tree smaller and more scalable. In SQL Serer 2005, the leaf-level of the index can include additional non-key columns. This continues to help keep the tree structure scalable but also allows you to cover more queries.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>I have installed SQL Server 2005 CTP, but can only find SQL Configuration Manager. I don&#39;t see the management tools that you are using. Any suggestions?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Actually, no. This seems a bit strange?! I might try uninstalling and re-installing, as well as reviewing the setup logs to see if there are errors within them. For SQL Server 2005, all installation log files are stored in C:\\Program Files\\Microsoft SQL Server\\90\\Setup Bootstrap\\LOG.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q: if your non clustered index either includes all or part of the clustered index are the clustered index columns added again to the non clustered index?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">NO! SQL Server only adds the column(s) of the clustering key &ndash; if they are missing.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<strong><font color=\"#000000\"><font face=\"Times New Roman\">Q: Did you mention the cool timebound option in DTA?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">Yes, but only briefly. Vipul Shah discusses DTA in greater detail in these two webcasts.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<span style=\"font-size: 11pt; color: black\"><a href=\"\/blogs\/kimberly\/ct.ashx?id=1de5cfcc-493d-4874-aed4-7fb330f9eaf7&amp;url=http%3a\/\/msevents.microsoft.com\/CUI\/WebCastEventDetails.aspx%3fEventID%3d1032275587%26EventCategory%3d5%26culture%3den-US%26CountryCode%3dUS\" class=\"broken_link\"><font face=\"Times New Roman\">TechNet Webcast: Performance Diagnosis in SQL Server 2005 (Level 300)<\/a><font face=\"Times New Roman\"> by Vipul Shah<\/span><span style=\"font-size: 11pt; color: black\"><a href=\"\/blogs\/kimberly\/ct.ashx?id=1de5cfcc-493d-4874-aed4-7fb330f9eaf7&amp;url=http%3a\/\/msevents.microsoft.com\/CUI\/WebCastEventDetails.aspx%3fEventID%3d1032275655%26EventCategory%3d5%26culture%3den-US%26CountryCode%3dUS\" class=\"broken_link\"><font face=\"Times New Roman\">TechNet Webcast: SQL Server 2005 Database Tuning Advisor (Level 300)<\/a><font face=\"Times New Roman\"> by Vipul Shah<\/span><span><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp;<\/span><strong><font color=\"#000000\"><font face=\"Times New Roman\">Q<span>: <\/span>What is the fill factor and how is it used?<\/strong> <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font color=\"#000000\"><font face=\"Times New Roman\">I think I&rsquo;m going to defer you to the next session! Now, there&rsquo;s some motivation. <span style=\"font-family: Wingdings\"><span>J<\/span><\/span>\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp; <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font color=\"#000000\"><font face=\"Times New Roman\">And here are a few comments that I&rsquo;ve received! I just wanted to say thanks for your comments and thank yous&hellip; <span style=\"font-family: Wingdings\"><span>J<\/span><\/span><font face=\"Times New Roman\"> It&#39;s your questions that keep me on my toes and current. This is still fun so keep it coming.\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp; <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font color=\"#000000\"><font face=\"Times New Roman\"><strong>Comment: <\/strong>Thank you again, particularly for thoroughness and enthusiasm.\n<\/p>\n<p><font color=\"#000000\"><font face=\"Times New Roman\"><strong>Comment<span>: <\/span><\/strong>Let me add my voice to the chorus of &quot;thank you&#39;s&quot;, Kim. You&#39;re <span>&nbsp;<\/span>presentations and verbal Q&amp;As are great, and your online ones are a truly generous gift to the community. No other webcaster has come close to doing what you do. Many thanks from all of us.&nbsp;<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp; <\/p>\n<p style=\"margin: 0in 0in 0pt\">\n<font color=\"#000000\"><font face=\"Times New Roman\"><strong>Comment<span>: <\/span><\/strong>I must compliment you on your Q&amp;A in your blog &#8211; I&#39;ve just checked it out &#8211; couldn&#39;t be more comprehensive!\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp; <\/p>\n<p style=\"margin: 0in 0in 0pt\" class=\"MsoNormal\">\n<font color=\"#000000\"><font face=\"Times New Roman\">So &ndash; 4 down, 6 to go! Lots more questions coming I&rsquo;m sure <span style=\"font-family: Wingdings\"><span>J<\/span><\/span>\n<\/p>\n<p><font face=\"Times New Roman\" size=\"3\" color=\"#000000\">&nbsp; <\/p>\n<p style=\"margin: 0in 0in 0pt\" class=\"MsoNormal\">\n<font face=\"Times New Roman\" size=\"3\" color=\"#000000\">If you&rsquo;re interested in hearing more about fragmentation, how to view it, how to clean it up and finally, how to prevent it &ndash; here&rsquo;s the registration link:\n<\/p>\n<p><span style=\"font-size: 11pt; color: black\"><a href=\"https:\/\/msevents.microsoft.com\/cui\/Error.aspx?culture=en-US&amp;ErrorMsgID=ErrorMessage.EventDoesNotExist&amp;EventID=\"><font face=\"Times New Roman\">MSDN Webcast: A Primer to Proper SQL Server Development (Part 5 of 10): New Features in Indexing and Index Maintenance Best Practices (Level 200)<\/a><\/span><span style=\"font-size: 11pt; color: black\"><font face=\"Times New Roman\">&nbsp;<\/span><span style=\"font-size: 11pt; color: black\"><font face=\"Times New Roman\">Thanks!<\/span><span style=\"font-size: 11pt; color: black\"><font face=\"Times New Roman\">kt<\/span> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Effectively Designing a Scalable and Reliable Database A Primer to Proper SQL Server Development Indexing Best Practices, Part 4 of 10Presented by Kimberly L. Tripp, SQLskills.com&nbsp;For a list of the non-technical Resources related to this webcast, please review the following blog entry:MSDN Webcast Q&amp;A for Resources: Indexing Best Practices, Part 4 of 10 &nbsp;Technical Questions [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,27,36,47,49,58,65,78],"tags":[],"class_list":["post-663","post","type-post","status-publish","format-standard","hentry","category-design","category-events","category-indexes","category-msdn-webcasts","category-opinions","category-resources","category-sql-server-2005","category-tips"],"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/posts\/663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/comments?post=663"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/posts\/663\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/media?parent=663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/categories?post=663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/tags?post=663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}