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 Apple AirPods 5 with Charging Case

New Products

Are Apple AirPods 5 a better value at $129 and $149? Apple cuts the price of its wireless-charging model by $30 for 2026.

2026 Audio-Technica ARH-AL5NC Wireless Headphones 2026 Audio-Technica ARH-AL5NC Wireless Headphones

New Products

Can open-back headphones work as everyday wireless cans? Audio-Technica’s ATH-AL5NC add LDAC, ANC, wired playback and up to 75 hours of battery life.

2026 Marantz MCR 60n CD Player and Streaming Amplifier in Black 2026 Marantz MCR 60n CD Player and Streaming Amplifier in Black

Integrated Amps & Stereo Receivers

Marantz MCR 60n combines a CD player and streaming amplifier with HDMI eARC, MM phono and optional Dirac Live. Is this the all-in-one hi-fi...

Sony Headphone Launch - September 2026 Sony Headphone Launch - September 2026

New Products

Sony just dropped a trio of new wireless Bluetooth headphones at prices that students and young professionals will find hard to resist.

2026 Layer Audio Design Gen-300B Integrated Tube Amplifier Front 2026 Layer Audio Design Gen-300B Integrated Tube Amplifier Front

Headphone Amps

Layer's GEN-300B delivers 10 watts of Class A tube power for speakers and headphones from $1,499. Can it challenge far pricier 300B amps?

2026 Orchard Audio Starkrimson HT Ultra Front Angle 2026 Orchard Audio Starkrimson HT Ultra Front Angle

Amplifiers

Can GaN improve multichannel amplification? Orchard Audio’s Starkrimson HT Ultra offers 3, 4 or 5 channels with configurable 1200W power supplies

Gift Ideas?

Ultra Luxury Audiophile Cost no object Gift Guide 2026

Floorstanding Speakers

Discover the state-of-the-art high-end audio/video gear of 2026 in our cost-no-object audiophile gift guide, from reference components to statement loudspeaker systems and more.

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.