﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server Newbies  / when to defragment indexes / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 18 May 2013 00:26:56 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: when to defragment indexes</title><link>http://www.sqlservercentral.com/Forums/Topic1412494-1292-1.aspx</link><description>Hi ugo_boyThese links might help:http://technet.microsoft.com/en-us/library/ms189858.aspxhttp://www.mssqltips.com/sqlservertip/1852/sql-server-2005-index-best-practices/http://blog.sqlauthority.com/2008/03/27/sql-server-2005-find-index-fragmentation-details-slow-index-performance/</description><pubDate>Tue, 29 Jan 2013 01:00:25 GMT</pubDate><dc:creator>sqlnaive</dc:creator></item><item><title>RE: when to defragment indexes</title><link>http://www.sqlservercentral.com/Forums/Topic1412494-1292-1.aspx</link><description>[quote][b]Alexander Suprun (1/28/2013)[/b][hr][quote][b]ugo boy (1/28/2013)[/b][hr]I mean, if there are no searches done on the table[/quote] then you should DROP these indexes.[/quote]Keep in mind these statistics are cumulative and only show information since the last time the MSSQL service was started.  If you recently restarted the service and check this DMV, you may find many indexes that [i]don't appear to be used[/i]...so be careful deleting them without first checking whether they're really needed or not.</description><pubDate>Mon, 28 Jan 2013 18:11:17 GMT</pubDate><dc:creator>MyDoggieJessie</dc:creator></item><item><title>RE: when to defragment indexes</title><link>http://www.sqlservercentral.com/Forums/Topic1412494-1292-1.aspx</link><description>[quote][b]ugo boy (1/28/2013)[/b][hr]I mean, if there are no searches done on the table[/quote] then you should DROP these indexes.</description><pubDate>Mon, 28 Jan 2013 17:11:29 GMT</pubDate><dc:creator>Alexander Suprun</dc:creator></item><item><title>RE: when to defragment indexes</title><link>http://www.sqlservercentral.com/Forums/Topic1412494-1292-1.aspx</link><description>It can also be quite helpful to look at your cached execution plans to see which queries/procedures have inadequate query plans, this can be found by running the code below[code="sql"]SELECT         DB_NAME(st .dbid),       [cp] .[refcounts],       [cp] .[usecounts],       [cp] .[objtype], --,[st].[dbid]               --,[st].[objectid]        OBJECT_NAME(st .objectid),       [st] .[text],       [qp] .[query_plan]FROM     sys .dm_exec_cached_plans AS cpCROSS APPLY sys. dm_exec_sql_text(cp .plan_handle) AS stCROSS APPLY sys. dm_exec_query_plan(cp .plan_handle) AS qpWHERE    [st]. [dbid] IN (7, 12,13 ,15)      AND [st].[text] NOT LIKE '%sp_M%'      AND [st]. [text] NOT LIKE '%sys%'      --AND cp.objtype = 'adhoc'ORDER BY usecounts DESC [/code] If tables aren't being used by any query(ies), then having indexes on them is really overkill and ends up just consuming valuable server resources...not to mention adds extra time to any indexing strategy you may have in place.</description><pubDate>Mon, 28 Jan 2013 10:32:36 GMT</pubDate><dc:creator>MyDoggieJessie</dc:creator></item><item><title>RE: when to defragment indexes</title><link>http://www.sqlservercentral.com/Forums/Topic1412494-1292-1.aspx</link><description>Thanks Richard,Just the info I was looking for</description><pubDate>Mon, 28 Jan 2013 10:24:20 GMT</pubDate><dc:creator>ugo boy</dc:creator></item><item><title>RE: when to defragment indexes</title><link>http://www.sqlservercentral.com/Forums/Topic1412494-1292-1.aspx</link><description>The effect of fragmentation depends on whether in order scans are being performed - common in reporting databases - and also on the size. There is no real benefit with less than a few hundred pages, unless you have a tiny amount of RAM - and then you've got more serious problems.To see which indexes are being scanned have a look at sys.dm_db_index_operational_stats</description><pubDate>Mon, 28 Jan 2013 09:28:28 GMT</pubDate><dc:creator>Richard Fryar</dc:creator></item><item><title>when to defragment indexes</title><link>http://www.sqlservercentral.com/Forums/Topic1412494-1292-1.aspx</link><description>Hi All,I understand that indexes need to be defragmented when they get fragmented,however must one defragment an index even if it is 100% fragmented?I mean, if there are no searches done on the table, then it doesn't matter if it is 100% fragmented (does it?)but if searches are constantly done on the table then it would make sense to defrag the table so as to improve the search performance.Now comes my next question....How can I find out which tables are constantly searched and which ones are notThanks UgoBoy</description><pubDate>Mon, 28 Jan 2013 09:11:17 GMT</pubDate><dc:creator>ugo boy</dc:creator></item></channel></rss>