ALTER QUOTA

ALTER QUOTA

쿼터(quota)를 변경해요.

출처: 문서

본문

Syntax:

ALTER QUOTA [IF EXISTS] name [ON CLUSTER cluster_name]
    [RENAME TO new_name]
    [KEYED BY {user_name | ip_address | forwarded_ip_address | client_key | client_key,user_name | client_key,ip_address | normalized_query_hash} | NOT KEYED]
    [IPV4_PREFIX_BITS number]
    [IPV6_PREFIX_BITS number]
    [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 | queries_per_normalized_hash} = number } [,...] |
        NO LIMITS | TRACKING ONLY} [,...]]
    [TO {role [,...] | ALL | ALL EXCEPT role [,...]}]

user_name, ip_address, forwarded_ip_address, client_key, client_key, user_name, client_key, ip_address, normalized_query_hashsystem.quotas 테이블의 필드에 대응해요.

IPV4_PREFIX_BITSIPV6_PREFIX_BITS 옵션은 KEYED BYip_address 또는 forwarded_ip_address일 때만 사용할 수 있어요. 이들도 system.quotas 테이블의 필드에 대응합니다.

파라미터 queries, query_selects, query_inserts, errors, result_rows, result_bytes, read_rows, read_bytes, execution_time, queries_per_normalized_hashsystem.quotas_usage 테이블의 필드에 대응해요.

ON CLUSTER 절은 클러스터에서 쿼터를 생성할 수 있게 해주며, Distributed DDL을 참고하세요.

Examples

15개월 제약에서 현재 사용자의 최대 쿼리 수를 123개로 제한해요.

ALTER QUOTA IF EXISTS qA FOR INTERVAL 15 month MAX queries = 123 TO CURRENT_USER;

기본 사용자에 대해 30분 동안 최대 실행 시간을 0.5초로 제한하고, 5분기 동안 최대 쿼리 수를 321개, 최대 오류 수를 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;

Part of: ALTER

Related: CREATE QUOTA, ALTER, SHOW

더 알아보기 (Learn more)