{"id":11158,"date":"2020-10-08T15:20:34","date_gmt":"2020-10-08T13:20:34","guid":{"rendered":"https:\/\/www.codemotion.com\/magazine\/?p=11158"},"modified":"2020-10-08T17:06:39","modified_gmt":"2020-10-08T15:06:39","slug":"sql-server-index-fragmentation","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/","title":{"rendered":"Identifying and Resolving SQL Server Index Fragmentation"},"content":{"rendered":"\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-427736ba      \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tTable Of Contents\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap \">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#the-reason-for-variations-in-index-fragmentation-percentage\" class=\"uagb-toc-link__trigger\">The reason for variations in Index Fragmentation percentage<\/a><li class=\"uagb-toc__list\"><a href=\"#improving-db-performance-and-resolving-index-fragmentation\" class=\"uagb-toc-link__trigger\">Improving DB performance and resolving Index Fragmentation<\/a><li class=\"uagb-toc__list\"><a href=\"#how-to-determine-the-usage-of-the-equation\" class=\"uagb-toc-link__trigger\">How to determine the usage of the equation?<\/a><li class=\"uagb-toc__list\"><a href=\"#conclusions\" class=\"uagb-toc-link__trigger\">Conclusions<\/a><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\n\n\n<p class=\"eplus-YE5KVa\">In this <strong>SQL technology guide<\/strong>, we explore how to spot and resolve <strong><span id=\"urn:enhancement-988f8f6\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_index\">Index<\/span> <span id=\"urn:enhancement-5856e1b1\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/fragmentation_computing\">Fragmentation<\/span> in <span id=\"urn:enhancement-962bee74\" class=\"textannotation disambiguated wl-creative-work\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/microsoft_sql_server\">SQL Server<\/span><\/strong>. As <a href=\"https:\/\/www.codemotion.com\/magazine\/Glossary\/database-administrator\/\">administrators<\/a> will know, identification of <span id=\"urn:enhancement-6ce08aa4\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_index\">Index<\/span> fragmentation and <span id=\"urn:enhancement-e932b884\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/maintenance__repair__and_operations\">maintenance<\/span> of the same are crucial elements in database <span id=\"urn:enhancement-9ea51839\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/maintenance__repair__and_operations\">maintenance<\/span>.<\/p>\n\n\n\n<p class=\"eplus-MfUmTU\"><strong><span id=\"urn:enhancement-54ae50e1\" class=\"textannotation disambiguated wl-creative-work\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/microsoft_sql_server\">MS SQL Server<\/span><\/strong> always updates index statistics whenever an Insertion, Updating, or Deletion activity is performed on the <span id=\"urn:enhancement-241952e7\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/table_database\">table<\/span>. <span id=\"urn:enhancement-b637349e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_index\">Index<\/span> fragmentation is the index <span id=\"urn:enhancement-b4071d9d\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/performance\">performance<\/span> value, described in percentages, which can easily be fetched by the <span id=\"urn:enhancement-5a944fea\" class=\"textannotation disambiguated wl-creative-work\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/microsoft_sql_server\">SQL Server<\/span> DMV. Based on the index <span id=\"urn:enhancement-1dc7f829\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/performance\">performance<\/span> value, <span id=\"urn:enhancement-c9508c3a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/user_computing\">users<\/span> can easily correct the indexes in <span id=\"urn:enhancement-a6b63b67\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/maintenance__repair__and_operations\">maintenance<\/span> by simply revising the fragmentation percentage, using the Reorganize or Rebuild operations.<\/p>\n\n\n\n<div class=\"wp-block-image eplus-L4bSvq\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"281\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/sqlserver-1024x281.jpg\" alt=\"microsoft sql server\" class=\"wp-image-11205\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/sqlserver-1024x281.jpg 1024w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/sqlserver-300x82.jpg 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/sqlserver-768x211.jpg 768w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/sqlserver.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"eplus-0Bq991 wp-block-heading\">The reason for variations in Index Fragmentation percentage<\/h2>\n\n\n\n<p class=\"eplus-t3j74B\">There could be <strong>variations in <span id=\"urn:enhancement-32190b00\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_index\">Index<\/span> Fragmentation <span id=\"urn:enhancement-a3ffbde1\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/percentage\">percentages<\/span><\/strong> because the <span id=\"urn:enhancement-c1b7a548\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">page<\/span> orders may not coordinate with the actual order of the physical <span id=\"urn:enhancement-9a43955f\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">pages<\/span> in the <span id=\"urn:enhancement-10ff974b\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">page<\/span> allocation index. If <span id=\"urn:enhancement-c0757e60\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span> is modified in the <span id=\"urn:enhancement-61c778f7\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/table_database\">table<\/span>, information may be resized on the <span id=\"urn:enhancement-89583943\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span> <span id=\"urn:enhancement-fd161f8d\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">page<\/span>. The <span id=\"urn:enhancement-1e4a270a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">page<\/span> may be too full even before the update operation is executed throughout the <span id=\"urn:enhancement-ac4307be\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/table_database\">table<\/span>.<\/p>\n\n\n\n<p class=\"eplus-4pENjd\">However, it&#8217;s possible to create <strong>free space on the <span id=\"urn:enhancement-70bde69\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span> <span id=\"urn:enhancement-a8385291\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">page<\/span><\/strong> by  <span id=\"urn:enhancement-20f4a70c\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/performance\">performing<\/span> an update operation on the <span id=\"urn:enhancement-69752d91\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/table_database\">table<\/span>. The <span id=\"urn:enhancement-79f6bacd\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/user_computing\">users<\/span> can then observe <span id=\"urn:enhancement-d5521978\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">page<\/span> order on the <span id=\"urn:enhancement-9d675624\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/table_database\">table<\/span> by running a massive deletion operation. The <span id=\"urn:enhancement-bc592611\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">page<\/span> must not be either too full or empty <span id=\"urn:enhancement-1b160fdb\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">when running<\/span> these updating and deletion operations. Un-utilized free space may again cause an order mismatch between the logical <span id=\"urn:enhancement-646a4ea0\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">page<\/span> and the actual physical <span id=\"urn:enhancement-2d716a0e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">page<\/span>, which increases fragmentation and ends up compromising query <span id=\"urn:enhancement-e6c0e34b\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_performance\">performance<\/span>. It may also <strong>consume more server <span id=\"urn:enhancement-9bc2a744\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/resource_computing\">resources<\/span> and tends to increase the load<\/strong>.<\/p>\n\n\n\n<p class=\"eplus-q3YLi3\">It is also essential to say that index fragmentation will adversely affect <strong>query <span id=\"urn:enhancement-33f02806\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_performance\">performance<\/span><\/strong> only with a <span id=\"urn:enhancement-79362197\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">page<\/span> scan. In this case, it will increase the chances of poor <span id=\"urn:enhancement-d0fd7e83\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/performance\">performance<\/span> on other <a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/big-data-analyst\/newsql-overcoming-limitations-of-relational-and-nosql-databases\/\">SQL<\/a> requests, and queries with highly-fragmented indices across the <span id=\"urn:enhancement-e8372075\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/table_database\">table<\/span> may take additional time to execute.  Such queries may consume a lot more <span id=\"urn:enhancement-2075ea9b\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/resource\">resources<\/span> &#8211; <span id=\"urn:enhancement-3e0999e1\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/central_processing_unit\">CPU<\/span>, <span id=\"urn:enhancement-afac83a6\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/cache_computing\">Cache<\/span>, and <span id=\"urn:enhancement-b10fb29\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/input_output\">IO<\/span>. The <span id=\"urn:enhancement-232ee923\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/representational_state_transfer\">remaining<\/span>  <span id=\"urn:enhancement-532ddd05\" class=\"textannotation disambiguated wl-creative-work\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/sql\">SQL<\/span> requests may find it tough to complete the <span id=\"urn:enhancement-da1e021\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/business_operations\">operation<\/span> using the inconsistent server <span id=\"urn:enhancement-45133c25\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/resource_computing\">resources<\/span>. Tasks may even be blocked by running the <span id=\"urn:enhancement-a86df059\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/delete_sql\">Delete<\/span> or <span id=\"urn:enhancement-5be475c\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/update_sql\">Update<\/span> operations. The optimizer may not gather any information on index fragmentation while generating the given query <span id=\"urn:enhancement-84c16ca7\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/query_plan\">execution plan<\/span>.<\/p>\n\n\n\n<h2 class=\"eplus-lo58rW wp-block-heading\">Improving DB performance and resolving Index Fragmentation<\/h2>\n\n\n\n<p class=\"eplus-U5TRHA\">In this case, there may be many indexes created on a given <span id=\"urn:enhancement-dc9ecaba\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/table_database\">table<\/span> with combinations of different columns, and each of these indexes may show varying fragmentation percentages. Before deciding what is appropriate or considering an index that is in maintenance, <span id=\"urn:enhancement-23e95e9a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/user_computing\">users<\/span> may have to find the right threshold value for the given database. For <strong><span id=\"urn:enhancement-cbe248fb\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/performance_tuning\">performance tuning<\/span><\/strong> of your enterprise database there are advanced solutions, such as <strong><a aria-label=\"undefined (opens in a new tab)\" href=\"http:\/\/www.remotedba.com\/database-performance-tuning\/\" target=\"_blank\" rel=\"noreferrer noopener\">RemoteDBA.com<\/a><\/strong>. Providers like Remote DBA have gained the relevant skills and expertise in <span id=\"urn:enhancement-8926b916\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/performance_tuning\">performance tuning<\/span>, database fragmentation, troubleshooting, and various other tasks by handling many <span id=\"urn:enhancement-630f9607\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/project\">projects<\/span> with a subtle combination of all these <span id=\"urn:enhancement-5a3068dc\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/use_case\">use cases<\/span>.<br><br>Finding the object details ideally uses the T-<span id=\"urn:enhancement-a012b221\" class=\"textannotation disambiguated wl-creative-work\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/sql\">SQL<\/span> <span id=\"urn:enhancement-1e4038b9\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/statement_computer_science\">statement<\/span> given below:<\/p>\n\n\n\n<div class=\"wp-block-image eplus-jr0cHY\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"565\" height=\"275\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/1.png\" alt=\"T-SQL statement for Index Fragmentation\" class=\"wp-image-11166\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/1.png 565w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/1-300x146.png 300w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/figure><\/div>\n\n\n\n<p class=\"eplus-4Q011C\">It is noticeable that 99% is the maximum average fragmentation, which may be engaged with another action to reduce fragmentation using choices such as <code>REBUILD<\/code> or <code>REORGANIZE<\/code>. These are <span id=\"urn:enhancement-c6e99ae7\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/command_computing\">commands<\/span> for index <span id=\"urn:enhancement-1fbc700f\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/maintenance__repair__and_operations\">maintenance<\/span>, which can be executed within the <span id=\"urn:enhancement-a812e1e5\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/statement_computer_science\">statement<\/span> of <code>ALTER INDEX<\/code>. <span id=\"urn:enhancement-49338695\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/user_computing\">Users<\/span> can also execute this <span id=\"urn:enhancement-d2543004\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/command_computing\">command<\/span> using the SSMS.<\/p>\n\n\n\n<p class=\"eplus-NNM1Wh\">You may also note that <code>REORGANIZE<\/code> and <code>REBUILD<\/code> are two choices to execute the trim <span id=\"urn:enhancement-708ce894\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/business_operations\">operation<\/span> over the given <span id=\"urn:enhancement-2390f808\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/page_computer_memory\">page<\/span>. However, this <span id=\"urn:enhancement-682f334\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/business_operations\">operation<\/span> needs to be executed during off-peak hours only to avoid any adverse <span id=\"urn:enhancement-9e2e9b16\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/social_influence\">impact<\/span> on <span id=\"urn:enhancement-76c5ee83\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/user_computing\">users<\/span> or <span id=\"urn:enhancement-ac089a98\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_transaction\">transactions<\/span>. The <span id=\"urn:enhancement-58ed252a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/business\">Enterprise<\/span> Edition of <span id=\"urn:enhancement-1476652d\" class=\"textannotation disambiguated wl-creative-work\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/microsoft_sql_server\">Microsoft SQL<\/span> Server supports the <span id=\"urn:enhancement-65c936f8\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/online_and_offline\">online<\/span> indexes, and the <span id=\"urn:enhancement-2c490481\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/online_and_offline\">offline<\/span> features are supported by the <code>REBUILD<\/code> index.<\/p>\n\n\n\n<p class=\"eplus-uVH0bb\"><code>INDEX REBUILD<\/code> tends to first drop the index and then reproduce it with new index pages. However, this task can be run simultaneously using the <span id=\"urn:enhancement-fe5e32b6\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/online_and_offline\">online<\/span> option, which is available in the <span id=\"urn:enhancement-e282ab30\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/business\">Enterprise<\/span> Edition using the <code>ALTER INDEX<\/code> <span id=\"urn:enhancement-b231361d\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/command_computing\">command<\/span>. However, this may not affect the run request or tasks running on other similar <span id=\"urn:enhancement-1a7d0c36\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/table_database\">tables<\/span>. The <code>REBUILD<\/code> <span id=\"urn:enhancement-259e923b\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_index\">Index<\/span> can also be set <span id=\"urn:enhancement-503427d2\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/online_and_offline\">offline<\/span> by using the <span id=\"urn:enhancement-ba1a9cdb\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/command_computing\">command<\/span> below:<\/p>\n\n\n\n<ul class=\"eplus-RBi4z3 wp-block-list\"><li>Offline:<br><code>ALTER INDEX Index_Name ON Table_Name REBUILD<\/code><\/li><li>Online:<br><code>ALTER INDEX Index_Name ON Table_Name REBUILD WITH(ONLINE=ON) | WITH(ONLINE=ON)<\/code><\/li><\/ul>\n\n\n\n<p class=\"eplus-v4u2rg\">On <span id=\"urn:enhancement-fe12e3e6\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/performance\">performing<\/span> <code>REBUILD INDEX<\/code> <span id=\"urn:enhancement-9d4cade0\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/online_and_offline\">offline<\/span>, the same index&#8217;s object <span id=\"urn:enhancement-702b6705\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/resource\">resource<\/span> <span id=\"urn:enhancement-93e6317b\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/table_database\">table<\/span> may not be accessible until the completion of the <code>REBUILD<\/code> process. However, this may also affect other <span id=\"urn:enhancement-ca71e2de\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_transaction\">transactions<\/span> that are running and associated with this <span id=\"urn:enhancement-17835a1\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/object_computer_science\">object<\/span>. Rebuild index operations can also recreate the index, generate a completely new statistic and then append the same log records from the index in the <span id=\"urn:enhancement-2f99327f\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data_logger\">log files<\/span> as a database <span id=\"urn:enhancement-7f54071f\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_transaction\">transaction<\/span>.<\/p>\n\n\n\n<p class=\"eplus-lx8tTX\">As we can see, there is a significant difference between <span id=\"urn:enhancement-f9a32c7e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_index\">Index<\/span> <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/solutioncenter.apexsql.com\/why-when-and-how-to-rebuild-and-reorganize-sql-server-indexes\/\" target=\"_blank\" rel=\"noreferrer noopener\">REORGANIZE and REBUILD options<\/a>. Database <span id=\"urn:enhancement-5f67de33\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/user_computing\">users<\/span> have a choice of any one of these alternatives, according to the index fragmentation <span id=\"urn:enhancement-6aab1349\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/percentage\">percentage<\/span>. There is no documented <span id=\"urn:enhancement-88720768\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/standardization\">standard<\/span>, but the <span id=\"urn:enhancement-fbd252b6\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/system_administrator\">admin<\/span> needs to follow the standard equation based on index size and type requirements.<\/p>\n\n\n\n<h2 class=\"eplus-ak26LY wp-block-heading\">How to determine the usage of the equation?<\/h2>\n\n\n\n<p class=\"eplus-EOk7dO\">When it comes to index fragmentation <span id=\"urn:enhancement-7ecd9a7d\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/percentage\">percentages<\/span>, it is always a question of how to determine the equation&#8217;s <span id=\"urn:enhancement-2aa3dbf7\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/usage\">usage<\/span>. The percentages commonly used to determine which equation to use are:<\/p>\n\n\n\n<ul class=\"eplus-U0FfZp wp-block-list\"><li>If you get a Fragmentation percentage between 15 to 30: <code>REORGANIZE<\/code><\/li><li>If you find a Fragmentation percentage of more than 30: <code>REBUILD<\/code><\/li><\/ul>\n\n\n\n<p class=\"eplus-nOGTE9\">In any given case, the <code>REBUILD<\/code> option can be more useful.  It thrives in the <code>ONLINE<\/code> option when the <span id=\"urn:enhancement-3882297e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/table_database\">database<\/span> is not made available for index <span id=\"urn:enhancement-710ad5f3\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/maintenance__repair__and_operations\">maintenance<\/span> during off-peak times.<\/p>\n\n\n\n<h2 class=\"eplus-pHKRkV wp-block-heading\">Conclusions<\/h2>\n\n\n\n<p class=\"eplus-Uvps21\">It&#8217;s clear that <span id=\"urn:enhancement-1cc4580c\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_index\">Index<\/span> <span id=\"urn:enhancement-2be4e282\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/fragmentation_computing\">Fragmentation<\/span> remains a critical internal fragmentation of the <span id=\"urn:enhancement-40bf0f79\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span> files. The core parameters one need to consider while assessing the <span id=\"urn:enhancement-f5c1938a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/performance\">performance<\/span> of <span id=\"urn:enhancement-56ef45a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database\">databases<\/span> are:<\/p>\n\n\n\n<ul class=\"eplus-3QcOAY wp-block-list\"><li>Database architecture plays a crucial role in enterprise database planning.<\/li><li>Database design based on the nature of data it holds and the storage plans<\/li><li>Proper query writing<\/li><\/ul>\n\n\n\n<p class=\"eplus-B9nEEp\">An ideal index design, properly <span id=\"urn:enhancement-5430eb89\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/maintenance__repair__and_operations\">maintained<\/span> from time to time will always boost query <span id=\"urn:enhancement-ef0e026a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/performance\">performance<\/span> in the given <span id=\"urn:enhancement-c3939499\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_engine\">database engine<\/span>, so make a wise choice for your <span id=\"urn:enhancement-f2a0bc06\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/business\">business<\/span>.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>In this SQL technology guide, we explore how to spot and resolve Index Fragmentation in SQL Server. As administrators will know, identification of Index fragmentation and maintenance of the same are crucial elements in database maintenance. MS SQL Server always updates index statistics whenever an Insertion, Updating, or Deletion activity is performed on the table.&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/\">Read more<\/a><\/p>\n","protected":false},"author":112,"featured_media":11165,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":4,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[36],"tags":[3360],"collections":[],"class_list":{"0":"post-11158","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-backend","8":"tag-database","9":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Identifying and Resolving SQL Server Index Fragmentation - Codemotion<\/title>\n<meta name=\"description\" content=\"Identifying index fragmentation is a crucial task for any database administrator. In this article, we explore how to spot and resolve it in SQL Server.\" \/>\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.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Identifying and Resolving SQL Server Index Fragmentation\" \/>\n<meta property=\"og:description\" content=\"Identifying index fragmentation is a crucial task for any database administrator. In this article, we explore how to spot and resolve it in SQL Server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-08T13:20:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-08T15:06:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Karen Anthony\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Karen Anthony\" \/>\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\":\"Article\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/\"},\"author\":{\"name\":\"Karen Anthony\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/22640041f8145f1c136f9c168f52cecf\"},\"headline\":\"Identifying and Resolving SQL Server Index Fragmentation\",\"datePublished\":\"2020-10-08T13:20:34+00:00\",\"dateModified\":\"2020-10-08T15:06:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/\"},\"wordCount\":976,\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg\",\"keywords\":[\"Database\"],\"articleSection\":[\"Backend\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/\",\"name\":\"Identifying and Resolving SQL Server Index Fragmentation - Codemotion\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg\",\"datePublished\":\"2020-10-08T13:20:34+00:00\",\"dateModified\":\"2020-10-08T15:06:39+00:00\",\"description\":\"Identifying index fragmentation is a crucial task for any database administrator. In this article, we explore how to spot and resolve it in SQL Server.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#primaryimage\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg\",\"width\":1200,\"height\":675,\"caption\":\"db\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Backend\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/backend\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Identifying and Resolving SQL Server Index Fragmentation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Codemotion.Italy\/\",\"https:\/\/x.com\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/22640041f8145f1c136f9c168f52cecf\",\"name\":\"Karen Anthony\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/65b43a760c7b3fcfa8297105dfe0da2c2468f102bf05a62541ef885b404b4d6a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/65b43a760c7b3fcfa8297105dfe0da2c2468f102bf05a62541ef885b404b4d6a?s=96&d=mm&r=g\",\"caption\":\"Karen Anthony\"},\"url\":\"https:\/\/www.codemotion.com\/magazine\/author\/karen-anthony\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Identifying and Resolving SQL Server Index Fragmentation - Codemotion","description":"Identifying index fragmentation is a crucial task for any database administrator. In this article, we explore how to spot and resolve it in SQL Server.","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.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/","og_locale":"en_US","og_type":"article","og_title":"Identifying and Resolving SQL Server Index Fragmentation","og_description":"Identifying index fragmentation is a crucial task for any database administrator. In this article, we explore how to spot and resolve it in SQL Server.","og_url":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_published_time":"2020-10-08T13:20:34+00:00","article_modified_time":"2020-10-08T15:06:39+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg","type":"image\/jpeg"}],"author":"Karen Anthony","twitter_card":"summary_large_image","twitter_creator":"@CodemotionIT","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"Karen Anthony","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/"},"author":{"name":"Karen Anthony","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/22640041f8145f1c136f9c168f52cecf"},"headline":"Identifying and Resolving SQL Server Index Fragmentation","datePublished":"2020-10-08T13:20:34+00:00","dateModified":"2020-10-08T15:06:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/"},"wordCount":976,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg","keywords":["Database"],"articleSection":["Backend"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/","url":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/","name":"Identifying and Resolving SQL Server Index Fragmentation - Codemotion","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg","datePublished":"2020-10-08T13:20:34+00:00","dateModified":"2020-10-08T15:06:39+00:00","description":"Identifying index fragmentation is a crucial task for any database administrator. In this article, we explore how to spot and resolve it in SQL Server.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg","width":1200,"height":675,"caption":"db"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/sql-server-index-fragmentation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"Backend","item":"https:\/\/www.codemotion.com\/magazine\/backend\/"},{"@type":"ListItem","position":3,"name":"Identifying and Resolving SQL Server Index Fragmentation"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/22640041f8145f1c136f9c168f52cecf","name":"Karen Anthony","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/65b43a760c7b3fcfa8297105dfe0da2c2468f102bf05a62541ef885b404b4d6a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/65b43a760c7b3fcfa8297105dfe0da2c2468f102bf05a62541ef885b404b4d6a?s=96&d=mm&r=g","caption":"Karen Anthony"},"url":"https:\/\/www.codemotion.com\/magazine\/author\/karen-anthony\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db-600x400.jpg","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db-600x600.jpg","author_info":{"display_name":"Karen Anthony","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/karen-anthony\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg",1200,675,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db-150x150.jpg",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db-300x169.jpg",300,169,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db-768x432.jpg",768,432,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg",1200,675,false],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg",1200,675,false],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db.jpg",100,56,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db-180x128.jpg",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db-896x504.jpg",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db-400x225.jpg",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db-600x400.jpg",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/10\/db-600x600.jpg",600,600,true]},"uagb_author_info":{"display_name":"Karen Anthony","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/karen-anthony\/"},"uagb_comment_info":0,"uagb_excerpt":"In this SQL technology guide, we explore how to spot and resolve Index Fragmentation in SQL Server. As administrators will know, identification of Index fragmentation and maintenance of the same are crucial elements in database maintenance. MS SQL Server always updates index statistics whenever an Insertion, Updating, or Deletion activity is performed on the table.&#8230;&hellip;","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/11158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/112"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=11158"}],"version-history":[{"count":8,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/11158\/revisions"}],"predecessor-version":[{"id":15143,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/11158\/revisions\/15143"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/11165"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=11158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=11158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=11158"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=11158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}