Solved

Index Fragmentation

Posted on 2012-03-28
5
302 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now