Connect with us

Hi, what are you looking for?

New Products

Defragmenting Databases. Myth or Real-McCoy?

Database servers suffer from two distinct types of fragmentation: internal and external. Internal fragmentation occurs when records are removed from database pages causing the space the record occupied to remain void after deletion. Eventually the space is reused but as it is reused, the database pages become fragmented which can lead to unnecessary time spent with I/O processes. In SQL Server, there are several ways to defrag internal fragmentation. One of these methods is to use the DBCC REINDEX command to rebuild clustered and non-clustered indexes. Once indexes are rebuilt database pages are now logically contiguous, and disk I/O is minimized.

External fragmentation refers to the fragmentation of files on your server’s disks, which can cause as much, if not more, unnecessary I/O activity as internal fragmentation. Database servers are made up of large database and log files that are pre-allocated in size at the point of their creation. If there is enough contiguous empty space on disk when the original files are created then they will not be fragmented. However, if there is not enough contiguous empty space on the disk then these original database and log files will be fragmented and spread across the empty space on your disk.

Even if the original database and log files are not fragmented when they are first created, they will almost certainly become fragmented as the database grows over time and the unnecessary I/O activity to read the fragmented database and log files hurts SQL Server’s overall performance.

To defrag external fragmentation takes an operating system utility, not a SQL Server utility. When the fragmentation tool runs, it does not restructure internal contents of the file, unlike DBCC REINDEX.

After the database and log files are defragmented, the defragmented files will be a contiguous bit for bit duplicate of the original. Therefore, any holes within the database pages are still present and you will still need, from time to time, to rebuild your indexes to combat internal fragmentation.

File defrag is not going to solve all DB-optimization requirements, but it is often lesser-known piece in the puzzle. So the next time your colleague suggest that your database server does not need a defragmenter, think again.

Advertisement. Scroll to continue reading.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Advertisement

Latest Products

2026 Focal Diva Alta Utopia Loudspeakers in Grey Felt

New Products

Weighing 236 pounds per speaker, Focal Diva Alta Utopia combines PRISM tweeter tech, M-profile W midrange, UWB wireless, and 600 watts of Naim amplification...

Monitor Audio Radius 3 4G Speakers in Black on Console Monitor Audio Radius 3 4G Speakers in Black on Console

Bookshelf Speakers

Monitor Audio Radius Series 4G brings compact hi-fi speakers, on-wall models, and flexible mounting to modern homes and commercial spaces starting at $525 per...

2026 beyerdynamic DT 30 IE in-ear monitors for musicians 2026 beyerdynamic DT 30 IE in-ear monitors for musicians

IEMs

beyerdynamic DT 30 IE targets musicians who need stage clarity, secure fit, and isolation, not bloated bass for the train.

clearaudio N2 MM Phono Cartridge Connected to Black Tonearm clearaudio N2 MM Phono Cartridge Connected to Black Tonearm

New Products

Clearaudio N2 MM cartridge uses a carbon fibre PETG body, 8.5g weight and $290 price to challenge Audio-Technica, Grado, Ortofon and Sumiko.

JBL PartyBox 330 and 130 Party Speakers Lifestyle JBL PartyBox 330 and 130 Party Speakers Lifestyle

New Products

JBL PartyBox 330 and 130 add upgraded drivers, Auracast, mic and guitar inputs, fast charging, and party-ready power from $449.95.

2026 Fluance RT87 Dual Plinth Turntable in Walnut 2026 Fluance RT87 Dual Plinth Turntable in Walnut

New Products

Fluance RT87 flagship turntable adds dual-plinth isolation, a 22mm acrylic platter, and AT-VM95ML or 2M Blue cartridge options.

Gift Ideas?

Father's Day 2026 4K UHD Blu-ray Disc Movies

Gift Guides

Best Father’s Day 2026 4K Blu-ray box sets, from Spielberg and Jackie Chan to horror, giallo, Hamilton, and collector editions dad will love.

You May Also Like

Advertisement

ecoustics is a hi-fi and music magazine offering product reviews, podcasts, news and advice for aspiring audiophiles, home theater enthusiasts and headphone hipsters. Read more

Copyright © 1999-2026 ecoustics | Disclaimer: We may earn a commission when you buy through links on our site.