roworder 策略命令roworder policy command

本文介绍用于创建和更改行顺序策略的控制命令。This article describes control commands used for creating and altering row order policy.

显示 RowOrder 策略Show RowOrder policy

.show table <table_name> policy roworder

.show table * policy roworder

删除 RowOrder 策略Delete RowOrder policy

.delete table <table_name> policy roworder

更改 RowOrder 策略Alter RowOrder policy

.alter table <table_name> policy roworder (<row_order_policy>)

.alter tables (<table_name> [, ...]) policy roworder (<row_order_policy>)

.alter-merge table <table_name> policy roworder (<row_order_policy>)

示例Examples

下面的示例将 TenantId 列上的行顺序策略(升序)设置为主键,将 Timestamp 列上的行顺序策略(升序)设置为辅助键。The following example sets the row order policy on the TenantId column (ascending) as a primary key, and on the Timestamp column (ascending) as the secondary key. 然后查询策略。The policy is then queried.

.alter table events policy roworder (TenantId asc, Timestamp desc)

.alter tables (events1, events2, events3) policy roworder (TenantId asc, Timestamp desc)

.show table events policy roworder 
TableNameTableName RowOrderPolicyRowOrderPolicy
eventsevents (TenantId asc, Timestamp desc)(TenantId asc, Timestamp desc)