已答复 Physical Disk Defragmentation

  • Monday, April 18, 2011 4:48 PM
     
     

    Does operating system's disk defragmentation tool to defragment physical disk help to improve the performance of the databases? I do index defragmentation, not sure if I also need to do disk defragmentation also.

    Thanks.

All Replies

  • Monday, April 18, 2011 4:59 PM
     
     
    I usually do not defragment disk underlaying my databases. I do not think it will improve db performance, however in rare cases probably it can. I think the key it to properly plan your IO strategy and setup RAIDs correctly 
    With kind regards
    Krystian Zieja
    http://www.projectnenvision.com
    Follow me on twitter
    My Blog
  • Monday, April 18, 2011 5:00 PM
    Moderator
     
     
    Unless you ovweuse autogrow (and, horror, shrink) then file level fragmentation would be minimal. In general, you might want to check it out when you get your hands on a server you didn't maintain before (and might have been min-managed). But after that, unless your operating procedures are out of the ordinary, you wouldn't worry about it.
    Tibor Karaszi, SQL Server MVP | web | blog
  • Monday, April 18, 2011 5:14 PM
     
     

    Thanks for your replies. Is there a fragmentation level for the database disk that would indicate that a defragmentation task might help? For example, if the physical disk is >70% fragmented, wouldn't it help in some way?

     

  • Monday, April 18, 2011 5:33 PM
    Moderator
     
     Answered
    I'm not aware of any best practices suggestion a specific percentage value where it might hurt. As always, there are so many factors involved here. Like raid type, SAN or not, to what extent you do larger scans vs. smaller pointed queries, whether your queries are well supported by indexes. If you feel it is high (high number fo fragments) and it is doable, then I'd go for a defrag.
    Tibor Karaszi, SQL Server MVP | web | blog
    • Marked As Answer by FitzC Monday, April 18, 2011 5:36 PM
    •  
  • Monday, April 18, 2011 5:41 PM
     
     

    So if queries are well supported by indexes then disk defragmentation would not be needed, right? My understanding is that since indexes are helping to find rows, index defragmentation only should be enough in such case.

    Thanks.

  • Monday, April 18, 2011 5:49 PM
     
     
  • Monday, April 18, 2011 6:49 PM
     
     

    Very good articles.

    Well it seems that if the databases are receiving a lot of SELECT queries then disk defrag may help. I just checked sessions info for my server and although logical_reads have high values, reads or physical reads do not have high values. So, can I conclude that data is not being read frequently from the disks and therefore disk defrag might not help? Also, we have SAN/RAID 10 and it seems that disk defrag for logical volumes hasn't been encouraged in one article?

  • Tuesday, April 19, 2011 5:10 AM
     
     

    I believe it will help. See the links below for some technical info:

    Here is some information for you on physical disk defrag on servers:

    http://downloads.diskeeper.com/pdf/The-Impact-Of-Disk-Fragmentation-On-Servers.pdf

     

    And some recent info on best practices for SAN defrag:

    http://www.diskeeper.com/blog/post/2011/03/29/Best-Practices-SAN-defrag.aspx

     

    And here is a Windows IT Pro white Paper on SAN defrag:

    http://www.windowsitpro.com/whitepaper/storage/maximize-the-performance-of-your-windows-san-infrastructure-135539