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

LG W6 Wallpaper TV at CES 2026

New Products

LG came on strong at CES 2026 with a new suite of OLED TVs featuring stunning design and impressive video performance.

Shanling CT90 CD Transport Silver Angle Large Shanling CT90 CD Transport Silver Angle Large

CD Players

Shanling’s $999 CT90 CD transport targets modern CD collectors with digital-only outputs and Bluetooth, but skips SACD, analog outs, and compact rack-friendly design.

FiiO EH11 Retro Bluetooth Mini Headphones Lifestyle FiiO EH11 Retro Bluetooth Mini Headphones Lifestyle

New Products

FiiO’s EH11 headphones and updated JM21 music player target commuters and travelers with retro design, hi-res Bluetooth, solid performance, and an affordable $240 combo.

Audeze LCD-5s Headphones Audeze LCD-5s Headphones

New Products

Audeze debuts the LCD-5s at NAMM 2026 with SLAM acoustic technology and refined planar drivers—but will listeners pony up $4,500 for its flagship performance?

Meze Audio Strada Closed-back headphone lifestyle Meze Audio Strada Closed-back headphone lifestyle

New Products

Can Meze’s $799 STRADA closed-back headphones stand out with premium design, easy drivability, and balanced sound in today’s crowded high-end market?

SVS 3000 Revolution Series Subwoofers SVS 3000 Revolution Series Subwoofers

New Products

Just days after CES 2026, SVS’s 3000 R|Evolution subwoofers are now available—but do they raise the bar for output and control?

Gift Ideas?

Christmas 2025 gift guide for tech, hi-fi audio, headphones and home theater

Gift Guides

Last-minute shopper? These 12 hi-fi, headphone, and home theater gifts still ship in time for Christmas and Chanukah. Fast delivery, great picks.

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-2024 ecoustics | Disclaimer: We may earn a commission when you buy through links on our site.



SVS Bluesound PSB Speakers NAD Cambridge Audio Q Acoustics Denon Marantz Focal Naim Audio RSL Speakers