Purpose
You can use this statement to configure SQL characteristic-based throttling to fail SQL requests that match the configured throttling characteristic 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 characteristics 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. The default value is -1. For more information about this variable, see System variables in Reference Guide. For example, if the priorities of sessions a, b, and c are 1, 2, and 3, respectively, 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 | Implements throttling based on the SQL response time, in seconds. |
| CPU | Implements throttling based on the CPU utilization.
NoteThe current version does not support this parameter. |
| IO | Implements throttling based on the number of I/O operations.
NoteThe current version does not support this parameter. |
| NETWORK | Implements throttling based on the volume of the transmitted network traffic.
NoteThe current version does not support this parameter. |
| QUEUE_TIME | Implements throttling based on the queuing time, in seconds. |
| LOGICAL_READS | Implements throttling based on the number of logical reads.
NoteThe current version does not support this parameter. |
| DISABLE SQL | Disables throttling. |
Examples
Throttle requests with a queuing time longer than 0.1s in sessions whose priority value is smaller than or equal to 100.
obclient> ALTER SYSTEM ENABLE SQL THROTTLE FOR PRIORITY <= 100 USING QUEUE_TIME=0.1;