 |
|
SQL Server Tips by Robin Schumacher
|
Object Fragmentation
Plainly stated, the subject of SQL Server fragmentation is not that
simple to handle. There are a variety of factors to consider when
diagnosing fragmentation and contemplating the reorganization of
database objects.
SQL Server fragmentation can be broken down into two basic types:
-
External Fragmentation: This situation
exists when indexes have a logical order, based on their key
value, which does not match the actual physical order inside the
database file that houses the index. When an ordered scan is
performed on an index, I/O performance is enhanced when the
physical order of the database pages matches the logical order
of the index. This is because the disk head can scan in one
direction instead of moving back and forth to obtain the needed
information.
-
Internal Fragmentation: This situation
exists when tables and indexes are not utilizing space as
efficiently as they should. The amount of wasted space in the
database pages artificially inflates the size of the table or
index and causes more I/O to be performed than would otherwise
be needed if the object were compacted.
Fragmentation is not a performance factor
once data reaches the SQL Server memory caches.
The above book excerpt is from:
High-Performance SQL Server DBA
Tuning & Optimization Secrets
ISBN:
0-9761573-6-5
Robin Schumacher
http://www.rampant-books.com/book_2005_2_sql_server_dba.htm |