Solved

Index Fragmentation

Posted on 2012-03-28
5
306 Views
Last Modified: 2012-03-28
I was said that application is running slow so i need to make sure from the database point that it is working fine.
 When I check the fragmentation of index in all the table it  is fragmented by 80% or higher. But when I see the execution plan of some of the  query used by the application  there is  always index seek . Some of tables have 5 million rows and some has couple of hundreds of thousands .

So, my question  is Is it possible to use index seek  by the execution plan even though the index fragmentation is more than 80%. In such situation do I need to rebuild the indexes.
I haven't seen my maintenance plan for the index in the database in our system.

Could it possible that because of the index fragmentation  the application is being slow.


Thanks  in advance
0
Comment
Question by:manojbaba
  • 3
5 Comments
 
LVL 39

Expert Comment

by:lcohan
ID: 37778310
0
 

Author Comment

by:manojbaba
ID: 37778480
Thanks Icohan,  

The link was  very informative but I really wanted to get answer to this part of the question

Is it possible to use index seek  by the execution plan even though the index fragmentation is more than 80%. In such situation do I need to rebuild the indexes.
0
 
LVL 25

Expert Comment

by:TempDBA
ID: 37778491
Are this plans that you are talking about are actual plan or estimated plans? Defragmenting the indexes will be useful. Just also check whether the indexes that you are talking about are what really is being used in the plan..
0
 
LVL 39

Expert Comment

by:lcohan
ID: 37778764
"Is it possible to use index seek  by the execution plan even though the index fragmentation is more than 80%. In such situation do I need to rebuild the indexes."

Of course it is possible however the performance will suffer until you can rebuild the index. One issue may be if the index is clustered and there are gaps in keys then fragmentation may allways be there to some degree.
0
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
ID: 37778776
And I know there are ways to DEFRAG an index however from my SQL experience that never had a signifficant positive impact like rebuild or recreate no matter how painful that may sound. In fact you could add a parrallel index with same composition different name and ONLINE=ON, do a UPDATE STATISTICS on that table and eventualy a SP_RECOMPILE table_name to flush old query plans using old index from cache, drop old and refres stats again.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question