Is file fragmentation of the mdf file a problem?

I ran a defragmentation report on a SQL server and the mdf file for the database is reported as 99% fragmented. I asked a colleague, and they said that this could be normal, because it is just the way this type of file works internally.

Is this a problem and will it work with disk defragmentation for this file to improve database performance? This is a pain because it requires a lot of disk space, as it is a huge file, so I want to be sure that it is necessary.

Update

Another related question leading to answers. How this will affect RAID striping configurations. If data rotates across multiple disks, will defragmentation have less trouble?

+3
source share
3 answers

The short answer is yes, defragmentation will help.

Cluster indexes try to organize the index in such a way that only sequential reads are required. This is great if .MDF is contiguous on disk. Not so much if the file is distributed throughout the disk.

Also, despite the fact that SQL allocates blocks in 8K that should move the disk head all over the place, it results in significantly slower access time. You really want the file to be contiguous.

+2
source

, , . , , , , . (.. , , , ..).

. .

+3

A good way to avoid this is to not rely on the freeway. Let the MDF room breathe.

0
source

Source: https://habr.com/ru/post/1705945/


All Articles