.merge 盘区.merge extents

该命令合并指定表中由其 ID 指示的盘区。This command merges the extents indicated by their IDs in the specified table.

备注

在 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.

语法Syntax

.merge [async | dryrun] TableName ( GUID1 [, GUID2 ...] ) [with(rebuild=true)].merge [async | dryrun] TableName ( GUID1 [, GUID2 ...] ) [with(rebuild=true)]

有两种类型的合并操作:There are two types of merge operations:

  • “合并”,即重新构建索引Merge that rebuilds indexes
  • “重新生成”,即完全重新引入数据Rebuild that completely reingests the data

有三个可用选项:There are three options available:

  • async:以异步方式执行命令。async: Execute the command asynchronously.
    • 返回操作 ID (Guid)。An Operation ID (Guid) is returned.
    • 可以监视操作的状态。The operation's status can be monitored. 将操作 ID 与 .show operations <operation ID> 命令一起使用。Use the Operation ID with the .show operations <operation ID> command.
  • dryrun:该操作将仅列出应合并的盘区,但实际上不会合并它们。dryrun: The operation will only list the extents that should be merged, but won't actually merge them.
  • with(rebuild=true):将重新生成这些盘区,并重新引入数据,而非合并。with(rebuild=true): The extents will be rebuilt and the data reingested instead of merged. 将重新生成索引。The indexes will be rebuilt.

返回输出Return output

输出参数Output parameter 类型Type 说明Description
OriginalExtentIdOriginalExtentId stringstring 源表中原始盘区的唯一标识符 (GUID),该标识符已合并到目标盘区。A unique identifier (GUID) for the original extent in the source table, which has been merged into the target extent.
ResultExtentIdResultExtentId stringstring 从源盘区创建的盘区的唯一标识符 (GUID)。A unique identifier (GUID) for the extent that was created from the source extents. 失败时:“失败”或“放弃”。Upon failure: "Failed" or "Abandoned".
持续时间Duration timespantimespan 完成合并操作所需的时间段。The time period it took to complete the merge operation.

示例Examples

重新生成 MyTable 中的两个特定盘区,以异步方式执行。Rebuild two specific extents in MyTable, asynchronously.

.merge async MyTable (e133f050-a1e2-4dad-8552-1f5cf47cab69, 0d96ab2d-9dd2-4d2c-a45e-b24c65aa6687) with(rebuild=true)

合并 MyTable 中的两个特定盘区,以同步方式执行。Merge two specific extents in MyTable, synchronously.

.merge MyTable (12345050-a1e2-4dad-8552-1f5cf47cab69, 98765b2d-9dd2-4d2c-a45e-b24c65aa6687)

备注Notes

  • 通常,不应手动运行 .merge 命令。In general, .merge commands shouldn't be manually run. 根据表和数据库的合并策略,这些命令会在群集的后台连续自动运行。The commands are continuously and automatically run in the background of the cluster, according to the merge policies for tables and databases.
    • 有关将多个盘区合并为单个盘区的条件的详细信息,请参阅合并策略For more information on the criteria for merging multiple extents into a single one, see Merge Policy.
  • .merge 操作的最终状态可能为 Abandoned,可在使用操作 ID 运行 .show operations 时进行查看。.merge operations have a possible final state of Abandoned, which can be seen when running .show operations with the operation ID. 此状态表明源盘区未合并,因为某些源盘区不再存在于源表中。This state suggests the source extents weren't merged, since some of the source extents no longer exist in the source table. 发生以下情况时,会出现 Abandoned 状态:The Abandoned state happens when:
    • 源盘区已在表保留过程中被删除。The source extents have been dropped as part of the table's retention.
    • 源盘区已移到另一个表中。The source extents have been moved to a different table.
    • 已完全删除或重命名源表。The source table has been entirely dropped or renamed.