SQL Server->> Sparse file (sparse files)

Source: Internet
Author: User

Sparse file (sparse files) is not an attribute of SQL Server. It belongs to an attribute of the NTFS file system of Windows. If the data in a large file contains a large amount of "0 data" (which should be viewed from the binary), such a file can be called a sparse file. If you look at this file from a two-dimensional diagram, you will find that the file is like many holes, and that is the origin of "sparse". The problem with this kind of file is wasted space. For example, if you are using VMware workstatation to create a virtual machine, initializing the disk size to 40G,VM will inevitably generate one or more. vmdk files for the virtual machine. If the file system really allocates 40G of physical disk space to the virtual machine disk files, it is actually a big waste because it doesn't work so much at all. There are several ways to solve the problem. The first is to allocate the entire full size space, then write 0 of the unused space, and then compress the file size with NTFS compression technology. While this approach solves the problem of wasted space, there is a cost to the process of compressing and extracting files from the cache before they are written to disk, which is costly for a system or application in which a file operation is busy, such as frequent compression and decompression operations.

The practice of processing this file in NTFS is to allocate space only if the file's content area block is not a large amount of 0 data. When the contents of the cache are checked out of 0 of chunks of data before they are written to disk, NTFS does not write this part of the data to disk, but maintains a list of its own, recording the location of the 0 data. In this way, when the read file operation occurs and reads to 0 data, NTFS only needs to return a small portion of the 0 data to the buffer for the read operation, without having to write the 0 data to the cache completely.

Reference documents:
Sparse Files

What is Sparse Files and why should I care as SQL Server DBA?

SQL Server->> Sparse file (sparse files)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.