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

Secret Chord Analogue Vinyl Record Tracker

New Products

Secret Chord Analogue Vinyl Record Tracker tracks stylus wear, record cleaning, cartridge hours, and vinyl playback history for serious collectors.

2026 Volumio Primo V3 Music Streamer with Tablet 2026 Volumio Primo V3 Music Streamer with Tablet

Music Streamers

Volumio’s third-generation Primo V3 adds a faster processing platform, ESS ES9039Q2M DAC, NOS mode, eight DAC filters, selectable RCA and XLR output levels, and...

Shanling M0 Pura Portable Music Player in-hand Shanling M0 Pura Portable Music Player in-hand

DAPs

Shanling M0 Pura packs hi-res playback, dual DACs, microSD storage, Bluetooth, and USB DAC support into a tiny $129 DAP.

Final DX10000 CL Collectors Edition Headphones Final DX10000 CL Collectors Edition Headphones

New Products

Can Final’s $8,499 DX10000 CL justify its True Diamond driver and closed-back flagship design, or is the price the real headline?

Nothing Ear (3a) Wireless Earbuds Colors Nothing Ear (3a) Wireless Earbuds Colors

New Products

Nothing’s latest $99 wireless earbuds add Audio Snapshot, call recording, LDAC, 45 dB ANC, and up to 42 hours of battery life, giving the...

FiiO FG3 Gaming Headset Lifestyle FiiO FG3 Gaming Headset Lifestyle

New Products

Can FiiO’s $69 FG3 gaming headset deliver Hi-Fi dual-driver sound, virtual 7.1 surround, and browser EQ for budget gamers?

Gift Ideas?

Amazon Prime Day 2026 Gift Guide

Daily Deals

Amazon Prime Day is a four-day shopping event from June 23-26, 2026 offering the biggest discounts of the year on consumer electronics.

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.