変更クォータ。
構文:
ALTER QUOTA [IF EXISTS] name [ON CLUSTER cluster_name]
[RENAME TO new_name]
[KEYED BY {user_name | ip_address | client_key | client_key,user_name | client_key,ip_address} | NOT KEYED]
[FOR [RANDOMIZED] INTERVAL number {second | minute | hour | day | week | month | quarter | year}
{MAX { {queries | query_selects | query_inserts | errors | result_rows | result_bytes | read_rows | read_bytes | execution_time} = number } [,...] |
NO LIMITS | TRACKING ONLY} [,...]]
[TO {role [,...] | ALL | ALL EXCEPT role [,...]}]
キー user_name
、ip_address
、client_key
、client_key, user_name
および client_key, ip_address
は、system.quotas テーブルのフィールドに対応します。
パラメータ queries
、query_selects
、query_inserts
、errors
、result_rows
、result_bytes
、read_rows
、read_bytes
、execution_time
は、system.quotas_usage テーブルのフィールドに対応します。
ON CLUSTER
句を使用すると、クラスターにクォータを作成できます。詳細は Distributed DDL を参照してください。
例
現在のユーザーの最大クエリ数を制限し、15か月間で123クエリ制約を設定します:
ALTER QUOTA IF EXISTS qA FOR INTERVAL 15 month MAX queries = 123 TO CURRENT_USER;
デフォルトユーザーの最大実行時間を30分間で0.5秒に制限し、最大クエリ数を321、最大エラー数を5クォーターで10に制限します:
ALTER QUOTA IF EXISTS qB FOR INTERVAL 30 minute MAX execution_time = 0.5, FOR INTERVAL 5 quarter MAX queries = 321, errors = 10 TO default;