sys.internal_partitions (TRANSACT-SQL)sys.internal_partitions (Transact-SQL)

适用于: 是SQL Server是Azure SQL 数据库否Azure SQL 数据仓库否并行数据仓库APPLIES TO: yesSQL Server yesAzure SQL Database noAzure SQL Data Warehouse noParallel Data Warehouse

返回为每个跟踪基于磁盘的表的列存储索引的内部数据的行集的一行。Returns one row for each rowset that tracks internal data for columnstore indexes on disk-based tables. 这些行集是列存储索引的内部并跟踪已删除行、 行组映射和增量存储行组。These rowsets are internal to columnstore indexes and track deleted rows, rowgroup mappings, and delta store rowgroups. 它们为每个表分区; 每个跟踪数据每个表具有至少一个分区。They track data for each for each table partition; every table has at least one partition. SQL ServerSQL Server 每次重新生成列存储索引将重新创建行集。re-creates the rowsets each time it rebuilds the columnstore index.

列名Column name 数据类型Data type 描述Description
partition_idpartition_id bigintbigint 此分区的分区 ID。Partition ID for this partition. 在数据库中是唯一的。This is unique within a database.
object_idobject_id intint 包含分区的表的对象 ID。Object ID for the table that contains the partition.
index_idindex_id intint 对表定义的列存储索引的索引 ID。Index ID for the columnstore index defined on the table.

1 = 聚集列存储索引1 = clustered columnstore index

2 = 非聚集列存储索引2 = nonclustered columnstore index
partition_numberpartition_number intint 分区数。The partition number.

1 = 已分区表的第一个分区或未分区表的单个分区。1 = first partition of a partitioned table, or the single partition of a nonpartitioned table.

2 = 第二个分区中,依次类推。2 = second partition, and so on.
internal_object_typeinternal_object_type tinyinttinyint 跟踪列存储索引的内部数据的行集对象。Rowset objects that track internal data for the columnstore index.




internal_object_type_descinternal_object_type_desc nvarchar(60)nvarchar(60) COLUMN_STORE_DELETE_BITMAP-此位图索引跟踪标记为删除从列存储中的行。COLUMN_STORE_DELETE_BITMAP - This bitmap index tracks rows that are marked as deleted from the columnstore. 由于分区可以具有多个行组中的行,位图是为每个行组。The bitmap is for every rowgroup since partitions can have rows in multiple rowgroups. 行是仍以物理方式存在并已满空间位于在列存储中。The rows are that are still physically present and taking up space in the columnstore.

COLUMN_STORE_DELTA_STORE-存储组的行,调用的尚未压缩成列存储行组。COLUMN_STORE_DELTA_STORE - Stores groups of rows, called rowgroups, that have not been compressed into columnar storage. 每个表分区可以包含零个或多个增量存储行组。Each table partition can have zero or more deltastore rowgroups.

COLUMN_STORE_DELETE_BUFFER-用于维护到可更新非聚集列存储索引删除。COLUMN_STORE_DELETE_BUFFER - For maintaining deletes to updateable nonclustered columnstore indexes. 查询从基础的行存储表中删除行,删除缓冲区将跟踪从列存储中删除。When a query deletes a row from the underlying rowstore table, the delete buffer tracks the deletion from the columnstore. 当已删除的行数超过 1048576 时,它们合并成删除位图背景元组发动机线程或显式的 Reorganize 命令。When the number of deleted rows exceed 1048576, they are merged back into the delete bitmap by background Tuple Mover thread or by an explicit Reorganize command. 在任何给定时间点,删除位图的删除缓冲区的并集表示所有已删除的行。At any given point in time, the union of the delete bitmap and the delete buffer represents all deleted rows.

COLUMN_STORE_MAPPING_INDEX-只有在聚集列存储索引具有辅助的非聚集的索引时使用。COLUMN_STORE_MAPPING_INDEX - Used only when the clustered columnstore index has a secondary nonclustered index. 这将非聚集索引键映射到正确的行组和列存储中的行 ID。This maps nonclustered index keys to the correct rowgroup and row ID in the columnstore. 它只存储密钥的行,然后迁移到不同的行组;增量行组压缩到列存储中,以及合并操作将两个不同的行组中的行时,将发生这种情况。It only stores keys for rows that move to a different rowgroup; this occurs when a delta rowgroup is compressed into the columnstore, and when a merge operation merges rows from two different rowgroups.
Row_group_idRow_group_id intint 增量存储行组 ID。ID for the deltastore rowgroup. 每个表分区可以包含零个或多个增量存储行组。Each table partition can have zero or more deltastore rowgroups.
hobt_idhobt_id bigintbigint 内部行集对象的 ID。ID of the internal rowset object. 这是一个很好密钥来加入其他 Dmv 来获取有关内部行集的物理特征的详细信息。This is a good key for joining with other DMVs to get more information about the physical characteristics of the internal rowset.
rowsrows bigintbigint 此分区中的大约行数。Approximate number of rows in this partition.
data_compressiondata_compression tinyinttinyint 压缩的行集的状态:The state of compression for the rowset:

0 = NONE0 = NONE

1 = ROW1 = ROW

2 = PAGE2 = PAGE
data_compression_descdata_compression_desc nvarchar(60)nvarchar(60) 为每个分区的压缩状态。The state of compression for each partition. 行存储表的可能值为 NONE、ROW 和 PAGE。Possible values for rowstore tables are NONE, ROW, and PAGE. 列存储表的可能值为 COLUMNSTORE 和 COLUMNSTORE_ARCHIVE。Possible values for columnstore tables are COLUMNSTORE and COLUMNSTORE_ARCHIVE.
optimize_for_sequential_keyoptimize_for_sequential_key bitbit 1 = 分区最后一页插入启用了优化。1 = Partition has last-page insert optimization enabled.

0 = 默认值。0 = Default value. 分区具有禁用的最后一页插入优化。Partition has last-page insert optimization disabled.


要求 公共 角色具有成员身份。Requires membership in the public role. 有关详细信息,请参阅 Metadata Visibility ConfigurationFor more information, see Metadata Visibility Configuration.

一般备注General Remarks

SQL ServerSQL Server 每次创建或重新生成列存储索引将重新创建新的列存储内部索引。re-creates new columnstore internal indexes each time it creates or rebuilds a columnstore index.


A.A. 查看所有表的内部行集View all of the internal rowsets for a table

此示例返回所有表的内部列存储行集。This example returns all of the internal columnstore rowsets for a table. Hobt_id 还可用于查找有关特定行集的详细信息。You can also use the hobt_id to find more information about the specific rowset.

SELECT i.object_id, i.index_id,, p.hobt_id, p.internal_object_type_id, p.internal_object_type_desc  
FROM sys.internal_partitions AS p  
JOIN sys.indexes AS i  
on i.object_id = p.object_id  
WHERE p.object_id = OBJECT_ID ( '<table name' ) ;  

请参阅See Also

对象目录视图 (Transact-SQL) Object Catalog Views (Transact-SQL)
目录视图 (Transact-SQL) Catalog Views (Transact-SQL)
查询 SQL Server 系统目录常见问题解答Querying the SQL Server System Catalog FAQ