{"id":7339,"date":"2022-04-14T06:57:00","date_gmt":"2022-04-14T04:57:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=7339"},"modified":"2022-05-13T16:15:05","modified_gmt":"2022-05-13T14:15:05","slug":"sql-server-clustered-index","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/","title":{"rendered":"Clustered index in SQL Server"},"content":{"rendered":"\n<p id=\"h-what-is-a-sql-server-clustered-index-the-definition-of-a-sql-server-index-is-a-structure-i-e-a-file-stored-physically-in-a-disk-unlike-the-master-data-and-the-log-data-files-that-are-the-main-files-composing-a-database-basically-to-find-the-associated-lines-or-rows-faster-the-index-stores-more-key-columns-are-stored-in\"><strong>What is a SQL Server clustered index ? The definition of a SQL Server index is a structure, i.e. a file, stored physically in a disk. It&#8217;s like the master data file and the log data file that composes a database. Basically, to find the associated lines or rows faster, the index stores one or more key columns. So what&#8217;s the definition of a MS SQL clustered index ? <\/strong><\/p>\n\n\n\n<p>A table with a clustered index orders the data physically. In this case, the keys columns define this sort order. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-definition-of-a-clustered-index-in-ms-sql\">Definition of a clustered index in MS SQL<\/h2>\n\n\n\n<p>The clustered table stores the data once. So, a table have only one unique clustered index. Note that the SQL Server database system table structures and stores tables with an order only in this case. You can choose the order descending or ascending at the creation of a table.<\/p>\n\n\n\n<p>For the same reason if a given table do not have any clustered index then the data is stored without a specific order. It is the case for the non-clustered indexes. This page explains the <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/indexes\/clustered-and-nonclustered-indexes-described?view=sql-server-ver15\" target=\"_blank\">indexes in depth<\/a>.<\/p>\n\n\n\n<p>For both types of indexes (clustered or not) the index can be unique, like a primary key. So, the key columns identify all rows with a unique value.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-an-index-orders-the-data-of-the-table-physically-on-the-disk\">An index orders the data of the table physically on the disk<\/h3>\n\n\n\n<p>Moreover, the functional usage of the table directly impacts the decisions to have a unique index or not. <\/p>\n\n\n\n<p>For example, let us consider a sales table, with years, months, and days. If the business users use the month extensively in the queries, then having a clustered non unique index is particularly useful. For example, to do a delete and replace of the current month sales. Or to access directly in the disk one given month.<\/p>\n\n\n\n<p>Please note that the database management system maintains the indexes. The SQL Server service running the database is design for this maintenance task. Nevertheless, use a maintenance plan to check index fragmentation and <a href=\"https:\/\/expert-only.net\/sql-server\/index\/rebuild-sql-server-index\/\">rebuilt them explicitly to ensure efficient queries<\/a>. Especially for tables with frequent updates and inserts, like large transaction systems for retail or Data warehouse projects.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-frequently-asked-questions-about-clustered-indexes-in-sql-server\">Frequently Asked Questions about Clustered indexes in SQL Server<\/h3>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1601841360141\"><strong class=\"schema-faq-question\">How a SQL Server index works ?<\/strong> <p class=\"schema-faq-answer\">An index improves the performance of SQL queries by splitting physically the data of the table on the disk hosting the database. It can be compared to a tree with the branches being the partitions and the leaves the data. <\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1601841522132\"><strong class=\"schema-faq-question\">What is the difference between a clustered and non clustered index in SQL Server ?<\/strong> <p class=\"schema-faq-answer\">The main difference is that a clustered index stores the data of the table in an ordered manner, while a non-clustered index does not keep the data ordered.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1601841599391\"><strong class=\"schema-faq-question\">How to choose which column to be indexed in SQL Server ?<\/strong> <p class=\"schema-faq-answer\">The best column to index is a functional decision to take based on the usage of the table. The insert, delete and update frequency are also to take into consideration. The main goal is to index a column that segregates the best the data.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1601841813709\"><strong class=\"schema-faq-question\">When to use a clustered index in SQL Server ?<\/strong> <p class=\"schema-faq-answer\">It is recommended to use a SQL Server clustered index when you need to use a single index. Because one unique clustered index is allowed per table. If you need multiple indexes on the same table, then the non clustered indexes are best.<\/p> <\/div> <\/div>\n\n\n\n<p><strong>Below is an article from the T-SQL series, on <a href=\"https:\/\/expert-only.com\/en\/t-sql\/calculate-time-difference-hours-minutes-seconds-sql-server\/\">how to calculate the time difference in hours, minutes and seconds<\/a>.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-blog-sql-server-et-microsoft-it wp-block-embed-blog-sql-server-et-microsoft-it\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/expert-only.com\/en\/t-sql\/calculate-time-difference-hours-minutes-seconds-sql-server\/\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>What is a SQL Server clustered index ? The definition of a SQL Server index is a structure, i.e. a file, stored physically in a disk. It&#8217;s like the master data file and the log data file that composes <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/\" title=\"Clustered index in SQL Server\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":5657,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[454],"tags":[],"class_list":{"0":"post-7339","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-t-sql"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Clustered index in SQL Server - T-SQL<\/title>\n<meta name=\"description\" content=\"A SQL Server clustered index is a table stored in a file on the disk, with a specific order. The goal is to access data faster from tables.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Clustered index in SQL Server\" \/>\n<meta property=\"og:description\" content=\"A SQL Server clustered index is a table stored in a file on the disk, with a specific order. The goal is to access data faster from tables.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-14T04:57:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-05-13T14:15:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/light-bulb-B4BACF3D6C0_1920x1080.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"Clustered index in SQL Server\",\"datePublished\":\"2022-04-14T04:57:00+00:00\",\"dateModified\":\"2022-05-13T14:15:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/\"},\"wordCount\":593,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/light-bulb-B4BACF3D6C0_1920x1080.jpeg\",\"articleSection\":[\"T-SQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/\",\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/\",\"name\":\"Clustered index in SQL Server - T-SQL\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/light-bulb-B4BACF3D6C0_1920x1080.jpeg\",\"datePublished\":\"2022-04-14T04:57:00+00:00\",\"dateModified\":\"2022-05-13T14:15:05+00:00\",\"description\":\"A SQL Server clustered index is a table stored in a file on the disk, with a specific order. The goal is to access data faster from tables.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841360141\"},{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841522132\"},{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841599391\"},{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841813709\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/light-bulb-B4BACF3D6C0_1920x1080.jpeg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/light-bulb-B4BACF3D6C0_1920x1080.jpeg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Clustered index in SQL Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/expert-only.com\/en\/#website\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"name\":\"SQL and IT Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/expert-only.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/expert-only.com\/en\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\",\"https:\/\/x.com\/expert_only\",\"https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}},{\"@type\":\"Question\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841360141\",\"position\":1,\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841360141\",\"name\":\"How a SQL Server index works ?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"An index improves the performance of SQL queries by splitting physically the data of the table on the disk hosting the database. It can be compared to a tree with the branches being the partitions and the leaves the data. \",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841522132\",\"position\":2,\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841522132\",\"name\":\"What is the difference between a clustered and non clustered index in SQL Server ?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The main difference is that a clustered index stores the data of the table in an ordered manner, while a non-clustered index does not keep the data ordered.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841599391\",\"position\":3,\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841599391\",\"name\":\"How to choose which column to be indexed in SQL Server ?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The best column to index is a functional decision to take based on the usage of the table. The insert, delete and update frequency are also to take into consideration. The main goal is to index a column that segregates the best the data.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841813709\",\"position\":4,\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841813709\",\"name\":\"When to use a clustered index in SQL Server ?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"It is recommended to use a SQL Server clustered index when you need to use a single index. Because one unique clustered index is allowed per table. If you need multiple indexes on the same table, then the non clustered indexes are best.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Clustered index in SQL Server - T-SQL","description":"A SQL Server clustered index is a table stored in a file on the disk, with a specific order. The goal is to access data faster from tables.","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:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/","og_locale":"en_US","og_type":"article","og_title":"Clustered index in SQL Server","og_description":"A SQL Server clustered index is a table stored in a file on the disk, with a specific order. The goal is to access data faster from tables.","og_url":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2022-04-14T04:57:00+00:00","article_modified_time":"2022-05-13T14:15:05+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/light-bulb-B4BACF3D6C0_1920x1080.jpeg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"Clustered index in SQL Server","datePublished":"2022-04-14T04:57:00+00:00","dateModified":"2022-05-13T14:15:05+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/"},"wordCount":593,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/light-bulb-B4BACF3D6C0_1920x1080.jpeg","articleSection":["T-SQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/","url":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/","name":"Clustered index in SQL Server - T-SQL","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/light-bulb-B4BACF3D6C0_1920x1080.jpeg","datePublished":"2022-04-14T04:57:00+00:00","dateModified":"2022-05-13T14:15:05+00:00","description":"A SQL Server clustered index is a table stored in a file on the disk, with a specific order. The goal is to access data faster from tables.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841360141"},{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841522132"},{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841599391"},{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841813709"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/light-bulb-B4BACF3D6C0_1920x1080.jpeg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/light-bulb-B4BACF3D6C0_1920x1080.jpeg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"Clustered index in SQL Server"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL and IT Tutorials","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","caption":"Expert-Only"}},{"@type":"Question","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841360141","position":1,"url":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841360141","name":"How a SQL Server index works ?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"An index improves the performance of SQL queries by splitting physically the data of the table on the disk hosting the database. It can be compared to a tree with the branches being the partitions and the leaves the data. ","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841522132","position":2,"url":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841522132","name":"What is the difference between a clustered and non clustered index in SQL Server ?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The main difference is that a clustered index stores the data of the table in an ordered manner, while a non-clustered index does not keep the data ordered.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841599391","position":3,"url":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841599391","name":"How to choose which column to be indexed in SQL Server ?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The best column to index is a functional decision to take based on the usage of the table. The insert, delete and update frequency are also to take into consideration. The main goal is to index a column that segregates the best the data.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841813709","position":4,"url":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-clustered-index\/#faq-question-1601841813709","name":"When to use a clustered index in SQL Server ?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"It is recommended to use a SQL Server clustered index when you need to use a single index. Because one unique clustered index is allowed per table. If you need multiple indexes on the same table, then the non clustered indexes are best.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/7339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=7339"}],"version-history":[{"count":0,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/7339\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/5657"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=7339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=7339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=7339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}