Purpose
You can use this statement to configure SQL feature throttling to fail SQL requests that match the configured throttling features before they are processed, preventing them from affecting normal requests.
Syntax
alter_system_throttle_stmt:
ALTER SYSTEM throttle_action;
throttle_action:
ENABLE SQL THROTTLE [priority_option] [using_metric_option_list]
| DISABLE SQL
priority_option:
FOR PRIORITY <= INT_VALUE
using_metric_option_list:
USING metric_option_list
metric_option_list:
metric_option [metric_option ...]
metric_option:
RT = {INT_VALUE | DECIMAL_VALUE}
| CPU = {INT_VALUE | DECIMAL_VALUE}
| IO = INT_VALUE
| NETWORK = {INT_VALUE | DECIMAL_VALUE}
| QUEUE_TIME = {INT_VALUE | DECIMAL_VALUE}
| LOGICAL_READS = {INT_VALUE | DECIMAL_VALUE}
Parameters
| Parameter | Description |
|---|---|
| ENABLE SQL | Enables throttling. This parameter is followed by throttling features and eigenvalues. |
| FOR PRIORITY | The priority of sessions subject to throttling. Throttling applies only to certain sessions. You can use the session-level variable sql_throttle_priority to set the priority of the current session. Default value: -1. For more information about this variable, see “System variables” in the Reference Guide. For example, if the priorities of sessions a, b, and c are 1, 2, and 3, ALTER SYSTEM ENABLE SQL THROTTLE FOR PRIORITY <= 2 USING QUEUE_TIME=0.1; indicates that sessions a and b are subject to throttling, but session c is not. |
| RT | Performs throttling based on the SQL response time, in seconds. |
| CPU | Performs throttling based on the CPU utilization.
NoteThe current version does not support this parameter. |
| IO | Performs throttling based on the number of I/O operations.
NoteThe current version does not support this parameter. |
| NETWORK | Performs throttling based on the volume of the transmitted network traffic.
NoteThe current version does not support this parameter. |
| QUEUE_TIME | Performs throttling based on the queue waiting time, in seconds. |
| LOGICAL_READS | Performs throttling based on the number of logical reads.
NoteThe current version does not support this parameter. |
| DISABLE SQL | Disables throttling. |
Examples
Throttle requests whose queue waiting time exceeds 0.1s in sessions with PRIORITY less than or equal to 100.
obclient> ALTER SYSTEM ENABLE SQL THROTTLE FOR PRIORITY <= 100 USING QUEUE_TIME=0.1;