.show 盘区.show extents

备注

在 Kusto 中,数据分片被称为“盘区”,所有命令都将“extent”或“extents”作为同义词使用。Data shards are called extents in Kusto, and all commands use "extent" or "extents" as a synonym. 有关盘区的详细信息,请参阅盘区(数据分片)概述For more information on extents, see Extents (Data Shards) Overview.

.show extents 命令的类型如下:The types of .show extents commands are as follows:

备注

如果 .show extents 命令在具有多个区的范围(如数据库或群集)内运行,则可能会消耗大量资源。The .show extents command may consume a lot of resources if it runs on a scope (such as a database or a cluster) with many extents. 建议在尽可能小的范围内使用命令变量。We recommended using the command variant at the lowest possible scope. 表范围优于数据库范围,数据库范围优于群集范围。Table-scope is preferable over database-scope, and database-scope over cluster-scope. 包含筛选区功能的命令变量优于使用另一个查询来筛选命令结果。The command variant that includes filtering extents is preferable to filtering the results of the command using another query.

表范围Table scope

.show table TableName extents [(ExtentId1,...,ExtentIdN)] [hot] [where tags (has|contains|!has|!contains) Tag1 [and tags (has|contains|!has|!contains) Tag2...]].show table TableName extents [(ExtentId1,...,ExtentIdN)] [hot] [where tags (has|contains|!has|!contains) Tag1 [and tags (has|contains|!has|!contains) Tag2...]]

.show tables (TableName1,...,TableNameN) extents [(ExtentId1,...,ExtentIdN)] [hot] [where tags (has|contains|!has|!contains) Tag1 [and tags (has|contains|!has|!contains) Tag2...]].show tables (TableName1,...,TableNameN) extents [(ExtentId1,...,ExtentIdN)] [hot] [where tags (has|contains|!has|!contains) Tag1 [and tags (has|contains|!has|!contains) Tag2...]]

显示有关指定表中存在的盘区(数据分片)的信息。Shows information about extents (data shards) that are present in the specified tables. 数据库取自命令的上下文。The database is taken from the command's context. 如果指定了 hot则仅显示应位于热缓存中的盘区。If hot is specified, shows only extents that are expected to be in the hot cache.

建议Recommendations

  • 在命令中使用内置筛选功能比添加基于查询的筛选器(例如,添加 | where DatabaseName == '...'TableName == '...')更可取。Using built-in filtering capabilities in the command is preferred over adding a query-based filter (such as adding | where DatabaseName == '...' and TableName == '...').
  • 如果提供了盘区 ID 的可选列表,则返回的数据集仅限于这些盘区。If the optional list of extent IDs is provided, the returned data set is limited to those extents only.
    • 此方法比筛选“bare”命令的结果(添加 | where ExtentId in(...))要快得多。This method is much faster than filtering (adding | where ExtentId in(...)) to the results of "bare" commands.
  • 如果指定了 tags 筛选器:If tags filters are specified:
    • 返回的列表仅限于标记集合遵循所有提供的标记筛选条件的盘区。The returned list is limited to those extents whose tags collection obeys all of the provided tags filters.
    • 此方法比筛选(将 | where Tags has '...' and Tags contains '...' 添加到)“bare”命令的结果要快得多。This method is much faster than filtering (adding | where Tags has '...' and Tags contains '...' to) the results of "bare" commands.
    • has 筛选器是相等性筛选器。has filters are equality filters. 将筛选出未使用任何指定标记标记的盘区。Extents that aren't tagged with either of the specified tags will be filtered out.
    • !has 筛选器是相等负筛选器。!has filters are equality negative filters. 将筛选出使用任何指定标记标记的盘区。Extents that are tagged with either of the specified tags will be filtered out.
    • contains 筛选器是不区分大小写的子字符串筛选器。contains filters are case-insensitive substring filters. 将筛选出未将指定字符串作为其任何标记的子字符串的盘区。Extents that don't have the specified strings as a substring of any of their tags will be filtered out.
    • !contains 筛选器是不区分大小写的子字符串负筛选器。!contains filters are case-insensitive substring negative filters. 将筛选出其所带的任何标记的包含指定字符串的盘区。Extents that have the specified strings as a substring of any of their tags will be filtered out.

数据库范围Database scope

.show database DatabaseName extents [(ExtentId1,...,ExtentIdN)] [hot] [where tags (has|contains|!has|!contains) Tag1 [and tags (has|contains|!has|!contains) Tag2...]].show database DatabaseName extents [(ExtentId1,...,ExtentIdN)] [hot] [where tags (has|contains|!has|!contains) Tag1 [and tags (has|contains|!has|!contains) Tag2...]]

显示有关指定数据库中存在的盘区(数据分片)的信息。Shows information about extents (data shards) that are present in the specified database. 如果指定了 hot - 仅显示应位于热缓存中的盘区。If hot is specified - shows only extents that expected to be in the hot cache.

群集范围Cluster scope

.show cluster extents [hot].show cluster extents [hot]

显示有关群集中存在的盘区(数据分片)的信息。Shows information about extents (data shards) that are present in the cluster. 如果指定了 hot - 仅显示应位于热缓存中的盘区。If hot is specified - shows only extents that are expected to be in the hot cache.

输出Output

输出参数Output parameter 类型Type 说明Description
ExtentIdExtentId GuidGuid 盘区 IDID of the extent
DatabaseNameDatabaseName StringString 盘区所属的数据库Database that the extent belongs to
TableNameTableName 字符串String 盘区所属的表Table that the extents belong to
MaxCreatedOnMaxCreatedOn DateTimeDateTime 创建盘区时的日期时间。Date-time when the extent was created. 对于合并的盘区,则是源盘区中创建时间的最大值For a merged extent, the maximum of creation times among source extents
OriginalSizeOriginalSize DoubleDouble 盘区数据的原始大小(以字节为单位)Original size in bytes of the extent data
ExtentSizeExtentSize DoubleDouble 内存中的盘区大小(已压缩 + 索引)Size of the extent in memory (compressed + index)
CompressedSizeCompressedSize DoubleDouble 内存中盘区数据的压缩大小Compressed size of the extent data in memory
IndexSizeIndexSize DoubleDouble 盘区数据的索引大小Index size of the extent data
Blocks LongLong 盘区中的数据块数Number of data blocks in the extent
段数Segments LongLong 盘区中的数据段数Number of data segments in the extent
ExtentContainerIdExtentContainerId StringString 盘区所在的盘区容器的 IDID of the extent container the extent is in
RowCountRowCount LongLong 盘区中的行数Number of rows in the extent
MinCreatedOnMinCreatedOn DateTimeDateTime 创建盘区时的日期时间。Date-time when the extent was created. 对于合并的盘区,则是源盘区中创建时间的最小值For a merged extent, the minimum of creation times among the source extents
TagsTags StringString 为盘区定义的标记(如果有)Tags, if any, defined for the extent
种类Kind 字符串String 创建了区的存储引擎的类型(“StorageV2”或“StorageV3”)The kind of the storage engine that created the extent ("StorageV2" or "StorageV3")
DeletedRowCountDeletedRowCount LongLong 区中已删除的行数Number of deleted rows in the extent

示例Examples

标记的盘区Tagged extent

T 中的盘区 E 用标记 aaaBBBccc 进行标记。Extent E in table T is tagged with tags aaa, BBB, and ccc.

  • 此查询将返回 EThis query will return E:

      .show table T extents where tags has 'aaa' and tags contains 'bb'
    
  • 此查询不会返回 E,因为它未标记 aaThis query won't return E since it isn't tagged with aa:

      .show table T extents where tags has 'aa' and tags contains 'bb'
    
  • 此查询将返回 EThis query will return E:

      .show table T extents where tags contains 'aaa' and tags contains 'bb' 
    

显示创建的盘区量Show volume of extents created

显示每小时在特定数据库中创建的盘区量Show volume of extents being created per hour in a specific database

.show database MyDatabase extents | summarize count(ExtentId) by MaxCreatedOn bin=time(1h) | render timechart  

显示每个表每小时到达的数据量Show volume of data arriving by table per hour

.show database MyDatabase extents  
| summarize sum(OriginalSize) by TableName, MaxCreatedOn bin=time(1h)  
| render timechart

显示每个表的数据大小分布Show data size distribution by table

.show database MyDatabase extents | summarize sum(OriginalSize) by TableName

显示名为“GamesDB”的数据库中的所有盘区Show all extents in the database named 'GamesDB'

.show database GamesDB extents

显示名为“Games”的表中的所有盘区Show all extents in the table named 'Games'

.show table Games extents

显示特定表中的所有盘区Show all extents in specific tables

显示名为“TaggingGames1”和“TaggingGames2”并标记为“tag1”和“tag2”的表中的所有盘区Show all extents in the tables named 'TaggingGames1' and 'TaggingGames2', tagged with both 'tag1' and 'tag2'

.show tables (TaggingGames1,TaggingGames2) extents where tags has 'tag1' and tags has 'tag2'