<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nonclustered Indexes on SQL Server Scripts</title><link>https://www.sqlserver70.com/tags/nonclustered-indexes/</link><description>Recent content in Nonclustered Indexes on SQL Server Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>SQLServer70.com</copyright><lastBuildDate>Wed, 01 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.sqlserver70.com/tags/nonclustered-indexes/index.xml" rel="self" type="application/rss+xml"/><item><title>SQL Server Unused Indexes: sys.dm_db_index_usage_stats</title><link>https://www.sqlserver70.com/post/sql-server-unused-indexes-sys-dm-db-index-usage-stats/</link><pubDate>Wed, 01 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-unused-indexes-sys-dm-db-index-usage-stats/</guid><description>
&lt;h2 id="find-unused-nonclustered-indexes-in-sql-server"&gt;Find Unused Nonclustered Indexes in SQL Server&lt;/h2&gt;
&lt;p&gt;This script queries &lt;code&gt;sys.dm_db_index_usage_stats&lt;/code&gt; to identify nonclustered indexes that have never been used by any read operation since the last SQL Server restart, yet still carry write overhead with every INSERT, UPDATE, and DELETE on the table.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;Every nonclustered index in SQL Server has a cost: each time a row is inserted, updated, or deleted in the base table, SQL Server must also update every nonclustered index on that table. If an index is never used by the query optimizer — no seeks, scans, or lookups — it is pure overhead with no benefit. Over time, databases accumulate these unused indexes through abandoned development, changed application query patterns, or indexes added by automated tools without follow-up review. This script, from the DBA-Scripts collection by Bulent Gucuk, reads &lt;code&gt;sys.dm_db_index_usage_stats&lt;/code&gt; to expose every nonclustered index with zero read activity since the last server restart, and generates the DROP INDEX statement for each one.&lt;/p&gt;</description></item></channel></rss>