- SQL Server 2017 Administrator's Guide
- Marek Chmel Vladimír Mu?n?
- 420字
- 2021-07-02 21:51:38
Data files
Every database must have at least one data file called primary data file. This file is always bound to the primary filegroup. In this file is all the metadata of the database, such as structure descriptions (could be seen through views such as sys.objects, sys.columns, and others), users, and so on. If the database does not have other data files (in the same or other filegroups), all user data is also stored in this file, but this approach is good enough just for smaller databases.
Considering how the volume of data in the database grows over time, it is a good practice to add more data files. These files are called secondary data files. Secondary data files are optional and contain user data only.
Both types of data files have the same internal structure. Every file is pided into 8 KB small parts called data pages. SQL Server maintains several types of data pages such as data, data pages, index pages, index allocation maps (IAM) pages to locate data pages of tables or indexes, global allocation map (GAM) and shared global allocation maps (SGAM) pages to address objects in the database, and so on. Regardless of the type of a certain data page, SQL Server uses a data page as the smallest unit of I/O operations between hard disk and memory. Let's describe some common properties:
- A data page never contains data of several objects
- Data pages don't know each other (and that's why SQL Server uses IAMs to allocate all pages of an object)
- Data pages don't have any special physical ordering
- A data row must always fit in size to a data page
These properties could seem to be useless but we have to keep in mind that when we know these properties, we can better optimize and manage our databases.
Did you know that a data page is the smallest storage unit that can be restored from backup?
As a data page is quite a small storage unit, SQL Server groups data pages into bigger logical units called extents. An extent is a logical allocation unit containing eight coherent data pages. When SQL Server requests data from disk, extents are read into memory. This is the reason why 64 KB NTFS clusters are recommended to format disk volumes for data files. Extents could be uniform or mixed. Uniform extent is a kind of extent containing data pages belonging to one object only; on the other hand, a mixed extent contains data pages of several objects.
- 現代測控系統典型應用實例
- 精通MATLAB圖像處理
- 自動控制原理
- Julia 1.0 Programming
- 完全掌握AutoCAD 2008中文版:綜合篇
- 統計學習理論與方法:R語言版
- 精通數據科學算法
- Linux:Powerful Server Administration
- 菜鳥起飛系統安裝與重裝
- SAP Business Intelligence Quick Start Guide
- Hands-On Data Warehousing with Azure Data Factory
- INSTANT VMware vCloud Starter
- 運動控制系統(第2版)
- 大數據:引爆新的價值點
- Photoshop CS4數碼照片處理入門、進階與提高