估计表的大小Estimate the Size of a Table

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics 是并行数据仓库Parallel Data Warehouseyes并行数据仓库Parallel Data Warehouse适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics 是并行数据仓库Parallel Data Warehouseyes并行数据仓库Parallel Data Warehouse

可以使用下列步骤估计在表中存储数据所需的空间:You can use the following steps to estimate the amount of space required to store data in a table:

  1. 按照 估计堆的大小估计聚集索引的大小中的说明来计算堆或聚集索引所需空间。Calculate the space required for the heap or clustered index following the instructions in Estimate the Size of a Heap or Estimate the Size of a Clustered Index.

  2. 对于每个非聚集索引,按照 估计非聚集索引的大小中的说明来计算其所需空间。For each nonclustered index, calculate the space required for it by following the instructions in Estimate the Size of a Nonclustered Index.

  3. 对步骤 1 和步骤 2 中计算的值求和。Add the values calculated in steps 1 and 2.

另请参阅See Also

估计数据库的大小 Estimate the Size of a Database
估计堆的大小 Estimate the Size of a Heap
估计聚集索引的大小 Estimate the Size of a Clustered Index
估计非聚集索引的大小Estimate the Size of a Nonclustered Index