行顺序策略Row order policy

行顺序策略是在表上设置的可选策略,它为 Kusto 提供了一个有关数据分片中所需的行顺序的“提示”。The row order policy is an optional policy set on tables, that provides a "hint" to Kusto on the desired ordering of rows in a data shard.

该策略的主要目的不是改善压缩(尽管这是潜在的副作用),而是改善范围已缩小到经过排序的列中一小部分值的查询的性能。The main purpose of the policy is not to improve compression (although it is a potential side-effect), but to improve performance of queries which are known to be narrowed to a small subset of values in the ordered columns.

此策略适用于以下情况:Applying the policy is appropriate when:

  • 大多数查询筛选特定的大维度列的特定值(例如“应用程序 ID”或“租户 ID”)The majority of queries filter on specific values of a specific large-dimension column (such as an "application ID" or a "tenant ID")
  • 引入表中的数据不太可能按照此列预先排序。The data ingested into the table is unlikely to be pre-ordered according to this column.

尽管没有对可以定义为策略一部分的列(排序键)数量设置硬编码限制,但是每增加一列都将增加引入过程的开销,并且随着列的增加,有效收益将减少。While there are no hardcoded limits set on the amount of columns (sort keys) that can be defined as part of the policy, every additional column adds some overhead to the ingestion process, and as more columns are added - the effective return diminishes.

备注

将策略应用到表后,它将影响自此之后引入的数据。Once the policy is applied to a table, it will affect data ingested from that moment on.

可在此处找到用于管理行顺序策略的控制命令Control commands for managing Row Order policies can be found here