查询管理Queries management

.show 查询.show queries

.show queries 命令返回已达到最终状态的查询列表,并且调用该命令的用户有权查看:The .show queries command returns a list of queries that have reached a final state, and that the user invoking the command has access to see:

语法Syntax

.show queries.show queries

.show 正在运行的查询.show running queries

.show running queries 命令返回用户或另一个用户或所有用户当前正在执行的查询的列表。The .show running queries command returns a list of currently-executing queries by the user, or by another user, or by all users.

语法Syntax

.show running queries
  • (1) 返回调用用户当前正在执行的查询(需要读取访问权限)。(1) returns the currently-executing queries by the invoking user (requires read access).

.cancel 查询.cancel query

.cancel query 命令会开始尽力尝试取消特定正在运行的查询。The .cancel query command starts a best-effort attempt to cancel a specific running query.

  • 集群管理员可以取消任何正在运行的查询。Cluster admins can cancel any running query.
  • 数据库管理员可以取消对其具有管理员访问权限的数据库调用的任何正在运行的查询。Database admins can cancel any running query that was invoked on a database they have admin access on.
  • 所有主体都可以取消他们启动的正在运行的查询。All principals can cancel running queries that they started.

语法Syntax

.cancel query ClientRequestId [with ( reason = ReasonPhrase )].cancel query ClientRequestId [with ( reason = ReasonPhrase )]

  • ClientRequestId 是正在运行的查询的 ClientRequestId 属性的值,作为 string 文本。ClientRequestId is the value of the running query's ClientRequestId property, as a string literal.

  • ReasonPhrase:如果已指定,则为描述取消正在运行的查询的原因的 string 文本。ReasonPhrase: If specified, a string literal that describes the reason for canceling the running query. 如果查询成功取消,则此信息将包含在查询结果中。This information is included in the query results if it's successfully canceled.

示例Example

.cancel query "KE.RunQuery;8f70e9ab-958f-4955-99df-d2a288b32b2c"