Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Index Fragmentation

Posted on 2012-03-28
5
Medium Priority
?
312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 40

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 40

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 40

Accepted Solution

by:
lcohan earned 1500 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.

715 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