Note
This statement is available starting from OceanBase Database V4.3.5 BP3.
Purpose
This statement is used to create a throttling rule that specifies the throttling scope to limit the concurrency of specific SQL statements.
Limitations and considerations
To execute the CREATE CONCURRENT_LIMITING_RULE statement in Oracle mode of OceanBase Database, you must have the create any concurrent_limiting_rule privilege.
Syntax
CREATE CONCURRENT_LIMITING_RULE ccl_rule_name
ON `database`.`table`
TO '<usename>'@'ip'
FOR { ALL | UPDATE | SELECT | INSERT | DELETE }
filter_options:
[ FILTER BY KEYWORD('KEYWORD1', 'KEYWORD2',…) ]
with_options:
WITH MAX_CONCURRENCY = value1 [per sql]
Parameters
| Parameter | Description |
|---|---|
ccl_rule_name |
Required. The name of the throttling rule. |
database.table |
Required. The name of the database and table. You can use an asterisk (*) to match any database or table.
NoteTo avoid name conflicts with SQL keywords, we recommend that you enclose the rule name in backticks (`). |
<usename>@<host> |
Required. The name of the account. The host part can be specified as a wildcard (%). |
ALL|UPDATE \| SELECT \| INSERT\| DELETE |
Required. The type of SQL statements. Currently, the ALL, UPDATE, SELECT, INSERT, and DELETE types are supported.
NoteEach throttling rule can only specify one type of SQL statements. |
[ filter_options ] |
Optional. The throttling keywords.
Note
|
with_options |
Required. Used to control the concurrency of throttling and specify the throttling statistics granularity at the rule level or the statement level. Currently, only the MAX_CONCURRENCY parameter is supported, which specifies the maximum concurrency of SQL statements that match the throttling rule. |
Examples
Execute the following command to throttle based on keywords:
obclient> CREATE CONCURRENT_LIMITING_RULE sql1_keywords_ccl_rule
ON *.* TO '%'@'%' FOR SELECT
FILTER BY KEYWORD('table1', 'table2', 'c1') WITH MAX_CONCURRENCY 100;