<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SYS.INDEXES &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/sys-indexes/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Mon, 25 Dec 2017 11:52:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>SQL Server 2016: sys.dm_db_column_store_row_group_physical_stats to find fragmentation of Columnstore Indexes</title>
		<link>https://www.dbrnd.com/2018/01/sql-server-2016-sys-dm_db_column_store_row_group_physical_stats-to-find-fragmentation-of-columnstore-indexes/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 12 Jan 2018 16:16:26 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Columnstore Index]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server 2016]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[SYS.INDEXES]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4223</guid>

					<description><![CDATA[SQL Server 2016 introduced sys.dm_db_column_store_row_group_physical_stats system view for finding the information on Columnstore row groups and related fragmentation. This is an extended version of sys.column_store_row_groups. Using this system view, you can find information like total number of rows physically stored, and a column for the number of rows marked as deleted. [crayon-6ab50541bc43d281993322/]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-sys-dm_db_column_store_row_group_physical_stats-to-find-fragmentation-of-columnstore-indexes%2F&amp;linkname=SQL%20Server%202016%3A%20sys.dm_db_column_store_row_group_physical_stats%20to%20find%20fragmentation%20of%20Columnstore%20Indexes" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-sys-dm_db_column_store_row_group_physical_stats-to-find-fragmentation-of-columnstore-indexes%2F&amp;linkname=SQL%20Server%202016%3A%20sys.dm_db_column_store_row_group_physical_stats%20to%20find%20fragmentation%20of%20Columnstore%20Indexes" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-sys-dm_db_column_store_row_group_physical_stats-to-find-fragmentation-of-columnstore-indexes%2F&amp;linkname=SQL%20Server%202016%3A%20sys.dm_db_column_store_row_group_physical_stats%20to%20find%20fragmentation%20of%20Columnstore%20Indexes" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-sys-dm_db_column_store_row_group_physical_stats-to-find-fragmentation-of-columnstore-indexes%2F&amp;linkname=SQL%20Server%202016%3A%20sys.dm_db_column_store_row_group_physical_stats%20to%20find%20fragmentation%20of%20Columnstore%20Indexes" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-sys-dm_db_column_store_row_group_physical_stats-to-find-fragmentation-of-columnstore-indexes%2F&amp;linkname=SQL%20Server%202016%3A%20sys.dm_db_column_store_row_group_physical_stats%20to%20find%20fragmentation%20of%20Columnstore%20Indexes" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-sys-dm_db_column_store_row_group_physical_stats-to-find-fragmentation-of-columnstore-indexes%2F&amp;linkname=SQL%20Server%202016%3A%20sys.dm_db_column_store_row_group_physical_stats%20to%20find%20fragmentation%20of%20Columnstore%20Indexes" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-sys-dm_db_column_store_row_group_physical_stats-to-find-fragmentation-of-columnstore-indexes%2F&#038;title=SQL%20Server%202016%3A%20sys.dm_db_column_store_row_group_physical_stats%20to%20find%20fragmentation%20of%20Columnstore%20Indexes" data-a2a-url="https://www.dbrnd.com/2018/01/sql-server-2016-sys-dm_db_column_store_row_group_physical_stats-to-find-fragmentation-of-columnstore-indexes/" data-a2a-title="SQL Server 2016: sys.dm_db_column_store_row_group_physical_stats to find fragmentation of Columnstore Indexes"></a></p><p>SQL Server 2016 introduced sys.dm_db_column_store_row_group_physical_stats system view for finding the information on Columnstore row groups and related fragmentation.<br />
This is an extended version of sys.column_store_row_groups.</p>
<blockquote><p>Using this system view, you can find information like total number of rows physically stored, and a column for the number of rows marked as deleted.</p></blockquote>
<pre class="crayon-plain-tag">SELECT 
	OBJECT_NAME([i].[object_id]) AS TableName
	,[i].[name] AS IndexName	
	,[csrgps].[state_desc]
	,[csrgps].[total_rows]
	,[csrgps].[deleted_rows]
	,[csrgps].[size_in_bytes]
	,[csrgps].[trim_reason_desc]
	,[csrgps].[transition_to_compressed_state_desc]
	,[csrgps].[has_vertipaq_optimization]	
	,[csrgps].[created_time]
	,[csrgps].[closed_time]
	,100 * (ISNULL(csrgps.[deleted_rows],0)) / total_rows AS 'IsFragmentation'
FROM sys.indexes AS i
INNER JOIN sys.dm_db_column_store_row_group_physical_stats AS csrgps
	ON [i].[object_id] = [csrgps].[object_id] 
		AND [i].index_id = [csrgps].index_id  
ORDER BY [TableName], [IndexName] 
GO</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Find Statisitcs Information of the Database Objects</title>
		<link>https://www.dbrnd.com/2016/12/sql-server-find-statisitcs-information-of-the-database-objects/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 18 Dec 2016 19:17:46 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[DBCC SHOW_STATISTICS]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[SYS.INDEXES]]></category>
		<category><![CDATA[sys.stats]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2497</guid>

					<description><![CDATA[The statistics of the Database Objects are playing very important role because Query Optimizer uses these statistics to choose the best execution plan. Query Optimizer requires different information like: number of rows, index information, change count and others. The updated statistics always give a better performance so we should find last updated statistics time and [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-find-statisitcs-information-of-the-database-objects%2F&amp;linkname=SQL%20Server%3A%20Find%20Statisitcs%20Information%20of%20the%20Database%20Objects" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-find-statisitcs-information-of-the-database-objects%2F&amp;linkname=SQL%20Server%3A%20Find%20Statisitcs%20Information%20of%20the%20Database%20Objects" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-find-statisitcs-information-of-the-database-objects%2F&amp;linkname=SQL%20Server%3A%20Find%20Statisitcs%20Information%20of%20the%20Database%20Objects" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-find-statisitcs-information-of-the-database-objects%2F&amp;linkname=SQL%20Server%3A%20Find%20Statisitcs%20Information%20of%20the%20Database%20Objects" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-find-statisitcs-information-of-the-database-objects%2F&amp;linkname=SQL%20Server%3A%20Find%20Statisitcs%20Information%20of%20the%20Database%20Objects" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-find-statisitcs-information-of-the-database-objects%2F&amp;linkname=SQL%20Server%3A%20Find%20Statisitcs%20Information%20of%20the%20Database%20Objects" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-find-statisitcs-information-of-the-database-objects%2F&#038;title=SQL%20Server%3A%20Find%20Statisitcs%20Information%20of%20the%20Database%20Objects" data-a2a-url="https://www.dbrnd.com/2016/12/sql-server-find-statisitcs-information-of-the-database-objects/" data-a2a-title="SQL Server: Find Statisitcs Information of the Database Objects"></a></p><p>The statistics of the Database Objects are playing very important role because Query Optimizer uses these statistics to choose the best execution plan. </p>
<p>Query Optimizer requires different information like: number of rows, index information, change count and others. </p>
<blockquote><p>The updated statistics always give a better performance so we should find last updated statistics time and if it is outdated, we should update statistics for that particular object. </p></blockquote>
<p>I am going to share three different scripts to find information about the information of tables and indexes. </p>
<p><strong>Using DBCC:</strong></p>
<pre class="crayon-plain-tag">-- This dbcc works up to SQL Server 2012.
DBCC SHOW_STATISTICS ('Table_Name', 'Index_Name') 
GO</pre> </p>
<p><strong>Using sys.stats:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	OBJECT_NAME(object_id) AS ObjectName
	,name AS StatisticName
	,STATS_DATE(object_id, stats_id) AS StatisticUpdateDate	
FROM sys.stats;
GO</pre> </p>
<p><strong>Using sys.indexes:</strong></p>
<pre class="crayon-plain-tag">SELECT 
    SCHEMA_NAME(SCHEMA_ID) AS SchemaName
    ,OBJECT_NAME(o.OBJECT_ID) AS ObjectName
    ,i.name AS IndexName
    ,STATS_DATE(o.OBJECT_ID,i.index_id) AS StatisticUpdateDate 
FROM sys.indexes AS i 
JOIN sys.objects AS o 
	ON i.object_id = o.object_id 
WHERE o.object_id &gt; 100 AND index_id &gt; 0 
  AND is_ms_shipped = 0
GO</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Script to find Redundant and Duplicate Indexes</title>
		<link>https://www.dbrnd.com/2016/11/sql-server-script-to-find-redundant-and-duplicate-indexes/</link>
					<comments>https://www.dbrnd.com/2016/11/sql-server-script-to-find-redundant-and-duplicate-indexes/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 02 Nov 2016 16:16:19 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[duplicate index]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[SYS.INDEXES]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2586</guid>

					<description><![CDATA[In this post, I am going to share one T-SQL script to find duplicate and redundant Indexes of the SQL Server. I have found some of the junior and intermediate Database Developers, who are creating multiple duplicates indexes which are decreasing the overall performance of the database. Now the job of the Database Administrator is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F11%2Fsql-server-script-to-find-redundant-and-duplicate-indexes%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Redundant%20and%20Duplicate%20Indexes" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F11%2Fsql-server-script-to-find-redundant-and-duplicate-indexes%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Redundant%20and%20Duplicate%20Indexes" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F11%2Fsql-server-script-to-find-redundant-and-duplicate-indexes%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Redundant%20and%20Duplicate%20Indexes" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F11%2Fsql-server-script-to-find-redundant-and-duplicate-indexes%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Redundant%20and%20Duplicate%20Indexes" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F11%2Fsql-server-script-to-find-redundant-and-duplicate-indexes%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Redundant%20and%20Duplicate%20Indexes" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F11%2Fsql-server-script-to-find-redundant-and-duplicate-indexes%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Redundant%20and%20Duplicate%20Indexes" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F11%2Fsql-server-script-to-find-redundant-and-duplicate-indexes%2F&#038;title=SQL%20Server%3A%20Script%20to%20find%20Redundant%20and%20Duplicate%20Indexes" data-a2a-url="https://www.dbrnd.com/2016/11/sql-server-script-to-find-redundant-and-duplicate-indexes/" data-a2a-title="SQL Server: Script to find Redundant and Duplicate Indexes"></a></p><p>In this post, I am going to share one T-SQL script to find duplicate and redundant Indexes of the SQL Server.</p>
<blockquote><p>I have found some of the junior and intermediate Database Developers, who are creating multiple duplicates indexes which are decreasing the overall performance of the database.</p></blockquote>
<p>Now the job of the Database Administrator is to find and remove duplicate indexes from the database.</p>
<p>I have prepared a small demonstration by creating some of duplicate indexes and provided script to find that duplicate indexes.</p>
<p><strong>First, create a sample table:</strong></p><pre class="crayon-plain-tag">CREATE TABLE dbo.tbl_Students
(
	StudID INT IDENTITY(1,1)
	,FirstName VARCHAR(50)
	,LastName VARCHAR(50)
	,DOB DATETIME
	,CONSTRAINT pk_tbl_Students_StudID PRIMARY KEY(StudID)
)
GO</pre><p>
<strong>Create duplicate indexes on LastName column:</strong></p><pre class="crayon-plain-tag">CREATE NONCLUSTERED INDEX idx_tbl_Students_LastName_FirstName_DOB
ON dbo.tbl_Students (LastName,FirstName,DOB)
GO

CREATE NONCLUSTERED INDEX idx_tbl_Students_LastName_FirstName
ON dbo.tbl_Students (LastName,FirstName)
GO

CREATE NONCLUSTERED INDEX idx_tbl_Students_LastName
ON dbo.tbl_Students (LastName)
GO</pre><p>
<strong>Sample SELECT statements:</strong><br />
Below, both SELECT statements are using only one index (idx_tbl_Students_LastName_FirstName_DOB) because LastName column is duplicated in all the indexes.</p><pre class="crayon-plain-tag">SELECT *FROM dbo.tbl_Students WHERE LastName ='Patel' AND FirstName = 'Anvesh'
GO
SELECT *FROM dbo.tbl_Students WHERE LastName ='Patel'
GO</pre><p>
<strong>Script to find Duplicate Indexes:</strong></p><pre class="crayon-plain-tag">SELECT
	s.Name + '.' + t.Name AS TableName	
	,i.name AS IndexName1	
	,DupliIDX.name AS IndexName2
	,c.name AS ColumnNae
FROM sys.tables AS t 
JOIN sys.indexes AS i
	ON t.object_id = i.object_id
JOIN sys.index_columns ic 
	ON ic.object_id = i.object_id 
		AND ic.index_id = i.index_id 
		AND ic.index_column_id = 1  
JOIN sys.columns AS c 
	ON c.object_id = ic.object_id 
		AND c.column_id = ic.column_id      
JOIN sys.schemas AS s 
	ON t.schema_id = s.schema_id
CROSS APPLY
(
	SELECT 
	   ind.index_id
	   ,ind.name
	FROM sys.indexes AS ind 
	JOIN sys.index_columns AS ico 
	   ON ico.object_id = ind.object_id
	   AND ico.index_id = ind.index_id
	   AND ico.index_column_id = 1  
	WHERE ind.object_id = i.object_id 
	   AND ind.index_id &gt; i.index_id
	   AND ico.column_id = ic.column_id
) DupliIDX     
ORDER BY
    s.name,t.name,i.index_id
GO</pre><p>
<strong>The Result:</strong></p>
<p><a href="https://www.dbrnd.com/wp-content/uploads/2016/04/SQLServerDuplicateIndex.png" rel="attachment wp-att-2593"><img decoding="async" class="alignnone wp-image-2593 size-full" title="SQL Server Duplicate Index" src="https://www.dbrnd.com/wp-content/uploads/2016/04/SQLServerDuplicateIndex.png" alt="SQL Server Duplicate Index" width="608" height="81" srcset="https://www.dbrnd.com/wp-content/uploads/2016/04/SQLServerDuplicateIndex.png 608w, https://www.dbrnd.com/wp-content/uploads/2016/04/SQLServerDuplicateIndex-300x40.png 300w, https://www.dbrnd.com/wp-content/uploads/2016/04/SQLServerDuplicateIndex-150x20.png 150w" sizes="(max-width: 608px) 100vw, 608px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/11/sql-server-script-to-find-redundant-and-duplicate-indexes/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: Script to find a Table which has more than 10 Indexes</title>
		<link>https://www.dbrnd.com/2016/10/sql-server-script-to-find-a-table-which-has-more-than-10-indexes-improve-performance/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 29 Oct 2016 16:16:17 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[indexes]]></category>
		<category><![CDATA[SQL Developer]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[SYS.INDEXES]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3422</guid>

					<description><![CDATA[In this post, I am sharing one T-SQL script to find a Table which has more than 10 Indexes in SQL Server. More Indexes on a Table, are creating a performance issue because Indexes also require dedicated CPU I/O for writing it into the Index Pages. More Indexes will slow down the insertion or any [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-10-indexes-improve-performance%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2010%20Indexes" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-10-indexes-improve-performance%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2010%20Indexes" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-10-indexes-improve-performance%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2010%20Indexes" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-10-indexes-improve-performance%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2010%20Indexes" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-10-indexes-improve-performance%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2010%20Indexes" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-10-indexes-improve-performance%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2010%20Indexes" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-10-indexes-improve-performance%2F&#038;title=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2010%20Indexes" data-a2a-url="https://www.dbrnd.com/2016/10/sql-server-script-to-find-a-table-which-has-more-than-10-indexes-improve-performance/" data-a2a-title="SQL Server: Script to find a Table which has more than 10 Indexes"></a></p><p>In this post, I am sharing one T-SQL script to find a Table which has more than 10 Indexes in SQL Server. </p>
<blockquote><p>More Indexes on a Table, are creating a performance issue because Indexes also require dedicated CPU I/O for writing it into the Index Pages.<br />
More Indexes will slow down the insertion or any other DML operation of that particular Table. </p></blockquote>
<p><strong>Below is a script to find out tables which are having more indexes:</strong><br />
You can change the value of @threshold.</p>
<pre class="crayon-plain-tag">DECLARE @threshold INT;
SET @threshold = 10;

SELECT
	[s].[name] + '.' + [t].[name] AS TableName
FROM sys.tables AS t
INNER JOIN sys.schemas AS s
	ON [t].[schema_id] = [s].[schema_id]
WHERE EXISTS
(
	SELECT 1 FROM sys.indexes AS i
    WHERE [i].[object_id] = [t].[object_id]
    GROUP BY [i].[object_id]
    HAVING COUNT(*) &gt; @threshold
)
GO</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Script to find Heap Table without having an Index</title>
		<link>https://www.dbrnd.com/2016/03/sql-server-script-to-find-heap-table-without-index/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 21 Mar 2016 18:45:19 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[heap table]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[SYS.INDEXES]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1998</guid>

					<description><![CDATA[In this post, I am sharing a script for a Database Administrator to find SQL Server Heap Tables which are not having a clustered index. A Table without a clustered index is called as Heap Table and Data is stored in the Heap without specifying an order. I have also published one article on, What [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-script-to-find-heap-table-without-index%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Heap%20Table%20without%20having%20an%20Index" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-script-to-find-heap-table-without-index%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Heap%20Table%20without%20having%20an%20Index" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-script-to-find-heap-table-without-index%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Heap%20Table%20without%20having%20an%20Index" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-script-to-find-heap-table-without-index%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Heap%20Table%20without%20having%20an%20Index" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-script-to-find-heap-table-without-index%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Heap%20Table%20without%20having%20an%20Index" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-script-to-find-heap-table-without-index%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Heap%20Table%20without%20having%20an%20Index" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-script-to-find-heap-table-without-index%2F&#038;title=SQL%20Server%3A%20Script%20to%20find%20Heap%20Table%20without%20having%20an%20Index" data-a2a-url="https://www.dbrnd.com/2016/03/sql-server-script-to-find-heap-table-without-index/" data-a2a-title="SQL Server: Script to find Heap Table without having an Index"></a></p><p>In this post, I am sharing a script for a Database Administrator to find SQL Server Heap Tables which are not having a clustered index. </p>
<p>A Table without a clustered index is called as Heap Table and Data is stored in the Heap without specifying an order. </p>
<p><a href="https://www.dbrnd.com/2015/08/what-is-heap-table/" target="_blank"><strong>I have also published one article on, What is Heap Table?<br />
You can visit this article here: </strong></a></p>
<p>Sometimes, database developer forgets to apply cluster index on a particular table and after that, the same table may have a lot of data which affect the query performance without having a clustered index. </p>
<p><strong>Below is a script:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	OBJECT_NAME(object_id) AS TableName
	,type_desc AS TableType
	,allow_row_locks
	,allow_page_locks
FROM sys.indexes 
WHERE index_id = 0</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Script to find Index Operational Stats</title>
		<link>https://www.dbrnd.com/2015/10/sql-server-script-to-find-index-operational-stats/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 17 Oct 2015 19:06:42 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[DM_DB_INDEX_OPERATIONAL_STATS]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[SYS.INDEXES]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=878</guid>

					<description><![CDATA[In this post, I am sharing a SQL script to find different operational stats of Indexes. This script is handy for DBA because sometimes it requires concluding that total how many time indexes are updated. Using below script, you can find the total number of INSERT, UPDATE and DELETE stats for indexes. [crayon-6ab50541bd6c3837834638/]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fsql-server-script-to-find-index-operational-stats%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Index%20Operational%20Stats" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fsql-server-script-to-find-index-operational-stats%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Index%20Operational%20Stats" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fsql-server-script-to-find-index-operational-stats%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Index%20Operational%20Stats" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fsql-server-script-to-find-index-operational-stats%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Index%20Operational%20Stats" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fsql-server-script-to-find-index-operational-stats%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Index%20Operational%20Stats" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fsql-server-script-to-find-index-operational-stats%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Index%20Operational%20Stats" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fsql-server-script-to-find-index-operational-stats%2F&#038;title=SQL%20Server%3A%20Script%20to%20find%20Index%20Operational%20Stats" data-a2a-url="https://www.dbrnd.com/2015/10/sql-server-script-to-find-index-operational-stats/" data-a2a-title="SQL Server: Script to find Index Operational Stats"></a></p><p>In this post, I am sharing a SQL script to find different operational stats of Indexes.</p>
<p>This script is handy for DBA because sometimes it requires concluding that total how many time indexes are updated.</p>
<p>Using below script, you can find the total number of INSERT, UPDATE and DELETE stats for indexes.</p>
<pre class="crayon-plain-tag">SELECT 
	OBJECT_NAME(DDIOS.OBJECT_ID) AS ObjectName
	,I.[NAME] AS IndexName
	,DDIOS.LEAF_INSERT_COUNT AS TotalInsertCount
	,DDIOS.LEAF_UPDATE_COUNT AS TotalUpdateCount
	,DDIOS.LEAF_DELETE_COUNT AS TotalDeleteCount
FROM SYS.DM_DB_INDEX_OPERATIONAL_STATS (NULL,NULL,NULL,NULL ) AS DDIOS
INNER JOIN SYS.INDEXES AS I 
	ON I.OBJECT_ID = DDIOS.OBJECT_ID
	AND I.INDEX_ID = DDIOS.INDEX_ID 
WHERE  OBJECTPROPERTY(DDIOS.OBJECT_ID,'IsUserTable') = 1</pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
