Solved

Index Fragmentation

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL convert varchar to INT 17 32
How to keep a record with the highest value 3 38
SQL Query help 3 24
SQL Distinct Question 3 13
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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 video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

756 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