Fragmented pages in tables not changing

  • I have several tables in a database that shows a high percentage in fragmentation. I created a maintenance plan and runs succesfully however, the fragmentation is not changing.

    For example the table below has a 52% fragmentation and pagecount of 109,208 but the rebuild index task doesn't change it.

    objectnameobjectidindexidpartitionnumfragpagecount

    pricevalue8329557311152.0331600907694109288

    I'm just wondering if there's anything I need to do or that I'm doing wrong.

    Thank you.

  • What are the contents of your maintenance plan?

    Does it rebuild indexes base on a fragmentation threshold.

    In general I would recommend Ola Hallengren's Index and Statistics maintenance script.

    It is widely considered the gold standard.

    http://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html

  • Do you have lots of free space in your databases?

    In terms of the object, what's the way that it's structured? Is the row size significant compare to page size? Fill factor? it's possible that you can't do much to change the fragmentation, I'd doubt it, but that could be the case.

    Can you give the DDL and commands you are running.

  • Got a shrink operation running, automatic or manual?

    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
  • ---What are the contents of your maintenance plan? Does it rebuild indexes base on a fragmentation threshold.

    I'm using the default setting for the rebuild index task which generates the script below:

    USE [TestDB]

    GO

    ALTER INDEX [pk_index] ON [dbo].[tablename] REBUILD PARTITION = ALL WITH ( PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, ONLINE = OFF, SORT_IN_TEMPDB = OFF )

    ----Do you have lots of free space in your databases? In terms of the object, what's the way that it's structured? Is the row size significant compare to page size? Fill factor? Can you give the DDL and commands you are running.

    The database is about 1.9 GB and it has about 25% free space of the mdf file. I think the row count is significatly bigger thatn the page count. The fill factor is the default.

    objectnameobjectidindexidpartitionnumfragpagecountRowCount

    pricevalue8329557311152.03316009076941092883977981

    --Got a shrink operation running, automatic or manual?

    No I don't have a shrink operation running.

    Thank you for all your replies. I'll be reviewing http://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html to hopefully find out more and learn more about rebuilding indexing.

Viewing 5 posts - 1 through 4 (of 4 total)

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