High Index Fragmentation in Database

  • Hi,

    The issue I am facing is that Index fragmentation on 15 tables on my database is high from 39%-95%. Even If I rebuild the index the fragmentation drops to 65% from 95% & gets to the same (95%) within an hour or 2. What could be the reason for this. 7 tables on the database have fragmentation % above 80%. Please advise.

    Regards,

    Nithin

  • Do they have more than 1000 pages of data?

    What's the leading column of the index? If it's a guid then yes it's normal.

    It's also possible if this is some sort of queue table.

  • Autoshrink on?

    Manual shrink jobs?

    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
  • No of pages: 1024

  • Index definition including the datatypes please.

    Is this table really heavy on insert / deletes?

  • No. Auto shrink is off & no shrinks applied as of now.

    There is a correction: I had mentioned 18 tables. It should be 18 Indexes. and the Indexes are spread across 3 tables. One table alone accounting for 12 indexes.

  • kr.nithin (5/11/2011)


    No. Auto shrink is off & no shrinks applied as of now.

    There is a correction: I had mentioned 18 tables. It should be 18 Indexes. and the Indexes are spread across 3 tables. One table alone accounting for 12 indexes.

    Ok... still waiting on previous question but it looks more and more like a queue table.

  • All indexes (12 indexes) are non-unique & non-clustered.

    10 out of 12 indexes are of Decimal(18,2) & 2 have INT on them.

    This table is not heavy on inserts or updates. Total 5000 records.

  • Maybe Gail has a better crystal ball that I do, but without seeing the columns, what type of data you keep in there and how the table is used it's really hard to tell you what's wrong.

    Can we at least see the table definition with the keys?

  • No primary key on the table . 1 foreign key.

  • Where are the indexes, and what types?

    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
  • Without a clustered index, the server doesn't need to maintain any order. So those table will always be fragmented (even if fragment means the order is not respected).

  • All the Indexes are non-unique & non-clustered.

  • kr.nithin (5/11/2011)


    All the Indexes are non-unique & non-clustered.

    Like I said, if you don't ask the server to keep then ordered, you can't complain that they are un-ordered

    Seriously. Put a clustered index on that table. It certainly needs one.

  • Thank you!!!!!!!!!!!!!

Viewing 15 posts - 1 through 15 (of 19 total)

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