{"id":516,"date":"2012-01-02T06:46:00","date_gmt":"2012-01-02T06:46:00","guid":{"rendered":"\/blogs\/paul\/post\/Survey-results-How-cluster-key-size-can-lead-to-GBs-of-wasted-space.aspx"},"modified":"2017-04-13T09:50:47","modified_gmt":"2017-04-13T16:50:47","slug":"survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/","title":{"rendered":"How cluster key size can lead to GBs of wasted space"},"content":{"rendered":"<p><span style=\"font-family: verdana, geneva; font-size: small;\">Back in November I kicked off a <\/span><a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-wasted-space-from-cluster-keys-code-to-run\/\"><span style=\"font-family: verdana, geneva; font-size: small;\">survey<\/span><\/a><span style=\"font-family: verdana, geneva; font-size: small;\"> that had you run some code to get some details about your cluster keys, nonclustered indexes, and table size. I got results from more than 500 systems across the world, resulting in 97565 lines of data &#8211; thanks! <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">The purpose of the survey is to highlight one of the side-effects of not adhering to the general guidelines (i.e. there are exceptions to these) for choosing a clustered index key. It should be, if possible: <\/span><\/p>\n<ol>\n<li>\n<div><span style=\"font-family: verdana, geneva; font-size: small;\">Narrow <\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"font-family: verdana, geneva; font-size: small;\">Static <\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"font-family: verdana, geneva; font-size: small;\">Ever-increasing <\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"font-family: verdana, geneva; font-size: small;\">Unique <\/span><\/div>\n<\/li>\n<\/ol>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">The survey and this post are intended to show how not adhering to Rule #1 can lead to performance problems. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Both Kimberly and I have explained in the past the architecture of nonclustered indexes &#8211; where every nonclustered index row has to have a link back to the matching heap or clustered index record. The link must be a unique value as it must definitively match a single record in the heap or clustered index. For nonclustered indexes on a table with a clustered index, this link is the cluster key (or keys) as these are guaranteed to be unique. Ah, you say, but what about when the clustered index is NOT defined as unique? That&#8217;s where Rule #4 comes in. For a non-unique clustered index, there will be a hidden 4-byte column (called the uniquifier) added when necessary as a tie-breaker when multiple clustered index records have the same key values. This increases the clustered index key size by 4 bytes (the uniquifier is an integer)\u00a0when needed. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">But I digress. The crux of the matter is that every nonclustered index record will include the cluster keys. The wider the cluster key size is (e.g. a few natural keys), the more overhead there is in each nonclustered index record, compared to using, for instance, an integer (4-byte) or bigint (8-byte)\u00a0surrogate cluster key. This can mean you&#8217;ve got the potential for saving huge amounts of space by moving to smaller clustered index keys &#8211; as we&#8217;ll see from the data I collected.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">The survey code I got you to run returned: <\/span><\/p>\n<ol>\n<li>\n<div><span style=\"font-family: verdana, geneva; font-size: small;\">Number of nonclustered indexes <\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"font-family: verdana, geneva; font-size: small;\">Number of cluster keys <\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"font-family: verdana, geneva; font-size: small;\">Total cluster key size <\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"font-family: verdana, geneva; font-size: small;\">Number of table rows <\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"font-family: verdana, geneva; font-size: small;\">Calculation of bytes used in all the nonclustered indexes to store the cluster keys in each row <\/span><\/div>\n<\/li>\n<\/ol>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">I did not take into account filtered indexes in 2008, or variable length cluster key columns, as to be honest although these will make a difference, for the purposes of my discussion here (making you aware of the problem), they&#8217;re irrelevant. It also would have made the survey code much more complex for me to figure out :-) <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Now let&#8217;s look at some of the results I received. To make things a little simpler, I discarded results from tables with less then ten thousand rows, and with clustered index key sizes less than 9. This dropped the number of data points from 97565 down to 22425. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">The graphs below show the estimated amount off savings that could be had in GB from moving to an 8-byte bigint, plotted against the first four factors in the list above. <\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/byncindexes.jpg\" \/><\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/bycluskeys.jpg\" \/><\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/byclussize.jpg\" \/><\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/bytablerows.jpg\" \/><\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">And here are the top 20 in terms of potential savings so you can see how the rough table schema:<\/span><\/p>\n<blockquote><p><span style=\"font-family: 'courier new', courier; font-size: small;\">NCIndexes\u00a0 ClusterKeys\u00a0 KeyWidth\u00a0 TableRows\u00a0\u00a0\u00a0\u00a0\u00a0 KeySpaceGB\u00a0 SavingsGB<br \/>\n&#8212;&#8212;&#8212;\u00a0 &#8212;&#8212;&#8212;&#8211;\u00a0 &#8212;&#8212;&#8211;\u00a0 &#8212;&#8212;&#8212;&#8212;-\u00a0 &#8212;&#8212;&#8212;-\u00a0 &#8212;&#8212;&#8212;<br \/>\n6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 72\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 891,751,171\u00a0\u00a0\u00a0 358.8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 352.1<br \/>\n6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 16\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3,189,075,035\u00a0 285.1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 261.4<br \/>\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 45\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4,479,327,954\u00a0 187.7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 154.4<br \/>\n6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 72\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 453,251,463\u00a0\u00a0\u00a0 182.4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 179.0<br \/>\n4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 16\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2,766,814,206\u00a0 164.9\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 144.3<br \/>\n4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 89\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 371,745,035\u00a0\u00a0\u00a0 123.3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 120.5<br \/>\n2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 774\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 76,337,053\u00a0\u00a0\u00a0\u00a0 110.1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 109.5<br \/>\n2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 774\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 76,331,676\u00a0\u00a0\u00a0\u00a0 110.0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 109.5<br \/>\n2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 774\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 75,924,837\u00a0\u00a0\u00a0\u00a0 109.5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 108.9<br \/>\n2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 774\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 75,533,539\u00a0\u00a0\u00a0\u00a0 108.9\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 108.3<br \/>\n5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 72\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 318,217,628\u00a0\u00a0\u00a0 106.7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 104.3<br \/>\n7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 60\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 269,590,810\u00a0\u00a0\u00a0 105.5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 103.4<br \/>\n22\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 13\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 389,203,725\u00a0\u00a0\u00a0 103.7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 100.8<br \/>\n22\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 13\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 329,772,049\u00a0\u00a0\u00a0 87.8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 85.4<br \/>\n2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 509\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 90,311,271\u00a0\u00a0\u00a0\u00a0 85.6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 85.0<br \/>\n17\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 510\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9,334,362\u00a0\u00a0\u00a0\u00a0\u00a0 75.4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 75.3<br \/>\n22\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 13\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 267,380,864\u00a0\u00a0\u00a0 71.2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 69.2<br \/>\n2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 172\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 219,929,560\u00a0\u00a0\u00a0 70.5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 68.8<br \/>\n22\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 13\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 261,967,851\u00a0\u00a0\u00a0 69.8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 67.8<br \/>\n6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 31\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 395,800,250\u00a0\u00a0\u00a0 68.6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 65.6<\/span><\/p><\/blockquote>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Wow &#8211; that&#8217;s some pretty amazing stuff &#8211; and that doesn&#8217;t even account for the space taken up by page headers etc.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">You might be thinking &#8211; why do I care? There are plenty of reasons:<\/span><\/p>\n<ul>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\">If you can save tens or hundreds of GBs by changing the cluster key to something much smaller, that translates directly into a reduction in size of your backups and data file disk space requirements.<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\">Smaller databases mean faster backups and restores.<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\">Making the nonclustered indexes smaller means that index maintenance (from inserts\/updates\/deletes) and index fragmentation removal will be much faster and generate less transaction log.<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\">Making the nonclustered indexes smaller means that consistency checking will be much faster &#8211; nonclustered index checking takes 30% of the CPU usage of DBCC CHECKDB.<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\">Reducing the width of nonclustered index records means the density of records (number of records per nonclustered index page) increases dramatically, leading to faster index processing, more efficient buffer pool (i.e. memory) usage, and fewer I\/Os as more of the indexes can fit in memory.<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\">Anything you can do to reduce the amount of transaction log directly affects the performance of log backups, replication, database mirroring, and log shipping.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">As you can see, there are many reasons to keep the cluster key as small as possible &#8211; all directly translating into performance improvements. For those of you that think that moving to a bigint may cause you to run out of possible keys, see <a href=\"http:\/\/sqlmag.com\/blog\/it-possible-run-out-bigint-values\" target=\"_blank\">this blog post<\/a> where I debunk that &#8211; unless you&#8217;ve got 3 million years and 150 thousand petabytes to spare&#8230;<\/span><\/p>\n<p><span style=\"font-size: small;\">One thing I&#8217;m not doing in this post is advocating any particular key over any other (although bigint identity does fit all the criteria from the top of the post) &#8211; except to try to keep it as small as possible. Choosing a good cluster key entails understanding the data and workload as well as the performance considerations of key size that I&#8217;ve presented here. And in some very narrow cases, not having a cluster key at all is acceptable &#8211; which means there&#8217;s 8 bytes in each nonclustered index record\u00a0(just to forestall those who may want to post a comment arguing against clustered indexes in general :-)<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Changing the cluster key can be tricky &#8211; Kimberly blogged a set of steps to follow plus some code to help you on our <\/span><a href=\"http:\/\/sqlmag.com\/blog\/changing-definition-clustered-index\" target=\"_blank\"><span style=\"font-family: verdana, geneva; font-size: small;\">SQL Server Magazine blog back in April 2010<\/span><\/a><span style=\"font-family: verdana, geneva; font-size: small;\">.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Later this week I&#8217;ll blog some code that will run through your databases and spit out table names that could have significant space savings from changing the cluster key.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">I won&#8217;t be blogging or tweeting much in January as we&#8217;ll be in Indonesia diving, but I will be posting photos later in the month.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Enjoy!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back in November I kicked off a survey that had you run some code to get some details about your cluster keys, nonclustered indexes, and table size. I got results from more than 500 systems across the world, resulting in 97565 lines of data &#8211; thanks! The purpose of the survey is to highlight one [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47,66,91],"tags":[],"class_list":["post-516","post","type-post","status-publish","format-standard","hentry","category-indexes-from-every-angle","category-performance-tuning","category-surveys"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How cluster key size can lead to GBs of wasted space - Paul S. Randal<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How cluster key size can lead to GBs of wasted space - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"Back in November I kicked off a survey that had you run some code to get some details about your cluster keys, nonclustered indexes, and table size. I got results from more than 500 systems across the world, resulting in 97565 lines of data &#8211; thanks! The purpose of the survey is to highlight one [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2012-01-02T06:46:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T16:50:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/byncindexes.jpg\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/\",\"name\":\"How cluster key size can lead to GBs of wasted space - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/byncindexes.jpg\",\"datePublished\":\"2012-01-02T06:46:00+00:00\",\"dateModified\":\"2017-04-13T16:50:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/#primaryimage\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/byncindexes.jpg\",\"contentUrl\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/byncindexes.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How cluster key size can lead to GBs of wasted space\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How cluster key size can lead to GBs of wasted space - Paul S. Randal","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/","og_locale":"en_US","og_type":"article","og_title":"How cluster key size can lead to GBs of wasted space - Paul S. Randal","og_description":"Back in November I kicked off a survey that had you run some code to get some details about your cluster keys, nonclustered indexes, and table size. I got results from more than 500 systems across the world, resulting in 97565 lines of data &#8211; thanks! The purpose of the survey is to highlight one [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/","og_site_name":"Paul S. Randal","article_published_time":"2012-01-02T06:46:00+00:00","article_modified_time":"2017-04-13T16:50:47+00:00","og_image":[{"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/byncindexes.jpg","type":"","width":"","height":""}],"author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/","name":"How cluster key size can lead to GBs of wasted space - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/byncindexes.jpg","datePublished":"2012-01-02T06:46:00+00:00","dateModified":"2017-04-13T16:50:47+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/#primaryimage","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/byncindexes.jpg","contentUrl":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2012\/1\/byncindexes.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-results-how-cluster-key-size-can-lead-to-gbs-of-wasted-space\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"How cluster key size can lead to GBs of wasted space"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=516"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/516\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}