Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 1.4 KB

sql-statement-query-watch.md

File metadata and controls

55 lines (42 loc) · 1.4 KB
title summary
QUERY WATCH
An overview of the usage of QUERY WATCH for the TiDB database.

QUERY WATCH

The QUERY WATCH statement is used to manually manage the watch list of runaway queries in a resource group.

Note:

This feature is not available on TiDB Serverless clusters.

Synopsis

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"
QueryWatchTextOption ::=
    "SQL" "DIGEST" SimpleExpr
|   "PLAN" "DIGEST" SimpleExpr
|   "SQL" "TEXT" ResourceGroupRunawayWatchOption "TO" SimpleExpr

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

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

Parameters

See QUERY WATCH parameters.

MySQL compatibility

This statement is a TiDB extension to MySQL syntax.

See also