Index Defragmentation

  • My production servers are not high OLTP system but i have to defragment some of the indexe's daily(fragmentation level sometimes goes as high as 85%).....I am trying to resolve this issue by analyzing the indexes....What are the various factors i need to consider

    Thanks in advance

    Regards,

    Pradeep

  • could be the fill factor is too low or the clustered index is on a column with lots of inserts\updates and the values are random (nonconsecutive)

    or the table could be a heap........

    ---------------------------------------------------------------------

  • You should check page splits through perfmon. if there are a lot of page splits occuring, then you need to look and adjust the fill factor. Also look at the cluster index keys, and if there a lot of ramdon inserts happening, you might want to change the keys.

  • PradeepVallabh (8/18/2010)


    What are the various factors i need to consider

    USE following query for every concerned table dbcc showcontig( 'tablename')

    for more details google "dbcc showcontig( 'tablename')"

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Don't use ShowContig. It's deprecated, will be removed in a future version of SQL server and should not be used for new development.

    The replacement is sys.dm_db_index_physical_stats

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • PradeepVallabh (8/18/2010)


    My production servers are not high OLTP system but i have to defragment some of the indexe's daily(fragmentation level sometimes goes as high as 85%).....I am trying to resolve this issue by analyzing the indexes....What are the various factors i need to consider

    Thanks in advance

    Regards,

    Pradeep

    Make sure that you are not only looking blindly at the % fragmentation. If the index is small a high fragmentation level is not a problem. You only need to be concerned with large indexes (above 1000 pages or so) that are heavily fragmented.

    How large (number of pages) are the problematic indexes ?

  • I HIGHLY recommend the database maintenance stuff (FREE!!) from ola.hallengren.com. Learn to use that stuff and stay away from maintenance plans!!

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • removed

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply