Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 1.32 KB

sql-statement-query-watch.md

File metadata and controls

61 lines (44 loc) · 1.32 KB
title summary
QUERY WATCH
TiDB 数据库中 QUERY WATCH 的使用概况。

QUERY WATCH

QUERY WATCH 语句用于在资源组中手动管理 Runaway Queries 监控列表。

语法图

AddQueryWatchStmt ::=
    "QUERY" "WATCH" "ADD" QueryWatchOptionList

QueryWatchOptionList ::=
    QueryWatchOption
|   QueryWatchOptionList QueryWatchOption
|   QueryWatchOptionList ',' QueryWatchOption

QueryWatchOption ::=
    "RESOURCE" "GROUP" ResourceGroupName
|   "RESOURCE" "GROUP" UserVariable
|   "ACTION" EqOpt ResourceGroupRunawayActionOption
|   QueryWatchTextOption

ResourceGroupName ::=
    Identifier
|   "DEFAULT"

ResourceGroupRunawayActionOption ::=
    DRYRUN
|   COOLDOWN
|   KILL
|   "SWITCH_GROUP" '(' ResourceGroupName ')'

QueryWatchTextOption ::=
    "SQL" "DIGEST" SimpleExpr
|   "PLAN" "DIGEST" SimpleExpr
|   "SQL" "TEXT" ResourceGroupRunawayWatchOption "TO" SimpleExpr

ResourceGroupRunawayWatchOption ::=
    "EXACT"
|   "SIMILAR"
|   "PLAN"

DropQueryWatchStmt ::=
    "QUERY" "WATCH" "REMOVE" NUM

参数说明

详见 QUERY WATCH 语句说明

MySQL 兼容性

该语句是 TiDB 对 MySQL 语法的扩展。

另请参阅