Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 1.52 KB

sql-statement-query-watch.md

File metadata and controls

65 lines (47 loc) · 1.52 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 Cloud 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"

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

Parameters

See QUERY WATCH parameters.

MySQL compatibility

This statement is a TiDB extension to MySQL syntax.

See also