Iain Hoult
Iain Hoult

Reputation: 4005

Why is my index getting fragmented?

I have a simple little table (just 8 fields) an hour ago I rebuilt one of the indexes on the table, which reset it to 0% fragmentation, but now it’s up to 38%.

The table itself has 400k records in it, but only 158 new ones have been inserted since I rebuilt the index, there have been no updates to records but perhaps a couple of deletes.

Why should the index be getting so fragmented?

The index is non-unique, non-clustered just on one field.

The database is running on SQL Server 2005 but with a compatibility level of SQL Server 2000.

Thanks

Upvotes: 0

Views: 2649

Answers (2)

Sam
Sam

Reputation: 7678

Fill factor 0 is equal to 100, so you are not allowing any room for inserts. You should be choosing a lower fill factor if you will be inserting.

Upvotes: 2

DCNYAM
DCNYAM

Reputation: 12126

Check the Fill Factor for that index when it is re-built. The fill factor may be too high. If this is the case, the index pages will be too full when the index is re-built and adding new rows will soon start to cause page splits (fragmentation). Reducing the fill factor on rebuild will allow more new records to be inserted into the index pages before page splitting starts to occur.

http://msdn.microsoft.com/en-us/library/aa933139%28SQL.80%29.aspx

Upvotes: 3

Related Questions