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 Esoteric F-01 Integrated Amplifier Black Edition

Integrated Amps & Stereo Receivers

Esoteric’s F-01 and F-02 Black Editions pair all-analog Grandioso-derived circuitry with a new black-anodized finish and optional PS-01F power supply.

2026 Element TiVo 4K TVs 2026 Element TiVo 4K TVs

New Products

Element’s new 50- and 65-inch TiVo OS TVs offer 4K, HDR, DTS:X and 150 preloaded apps, but no built-in app store.

2026 Toshiba REGZA ArtVision GS700 Art TV Lifestyle 2026 Toshiba REGZA ArtVision GS700 Art TV Lifestyle

New Products

Toshiba's premium priced 2026 Art TVs offer matte QLED display, 165Hz refresh rate, Fire TV, and subscription-free artwork in 55 to 75-inch sizes.

Amazon Fire TV 4K 3rd Gen 2026 Model with New Remote Amazon Fire TV 4K 3rd Gen 2026 Model with New Remote

Blu-ray, DVD & 4K Media Players

Amazon’s $59.99 Fire TV Stick 4K (3rd gen) adds Direct Power, Wi-Fi 6 and Vega OS while opting for HDR10+ support over Dolby Vision.

2026 Panasonic DMR-4X1010 10TB 4K Blu-ray Player and Recorder 2026 Panasonic DMR-4X1010 10TB 4K Blu-ray Player and Recorder

Blu-ray, DVD & 4K Media Players

Panasonic’s DMR-4X1010 combines 10TB, 11 tuners, cloud archiving and Ultra HD Blu-ray playback in a recorder built for Japan.

2026 Yamaha R200A Stereo Receiver Black Lifestyle 2026 Yamaha R200A Stereo Receiver Black Lifestyle

Integrated Amps & Stereo Receivers

After a decade, Yamaha finally replaces the R-S202 with the R200A, adding phono, subwoofer output, Bluetooth Multipoint, and chassis upgrades.

Gift Ideas?

Amazon Prime Big Deal Days October 6-7, 2026

Gift Guides

Check out huge discounts on Sony, Technics, TCL, AWOL, Audioengine, Andover, ZVOX and more for two days only on Amazon's October Prime Days.

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.