mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 07:01:59 +00:00
67 lines
3.1 KiB
Plaintext
67 lines
3.1 KiB
Plaintext
-- default
|
|
CREATE QUOTA q1_01297
|
|
-- same as default
|
|
CREATE QUOTA q2_01297
|
|
CREATE QUOTA q3_01297
|
|
CREATE QUOTA q4_01297
|
|
-- rename
|
|
CREATE QUOTA q2_01297_renamed
|
|
-- key
|
|
CREATE QUOTA q1_01297
|
|
CREATE QUOTA q2_01297 KEYED BY user_name
|
|
CREATE QUOTA q3_01297 KEYED BY ip_address
|
|
CREATE QUOTA q4_01297 KEYED BY client_key
|
|
CREATE QUOTA q5_01297 KEYED BY client_key, user_name
|
|
CREATE QUOTA q6_01297 KEYED BY client_key, ip_address
|
|
CREATE QUOTA q7_01297
|
|
CREATE QUOTA q8_01297 KEYED BY user_name
|
|
CREATE QUOTA q9_01297 KEYED BY ip_address
|
|
CREATE QUOTA q10_01297 KEYED BY client_key
|
|
CREATE QUOTA q11_01297 KEYED BY client_key, user_name
|
|
CREATE QUOTA q12_01297 KEYED BY client_key, ip_address
|
|
CREATE QUOTA q1_01297 KEYED BY user_name
|
|
CREATE QUOTA q2_01297 KEYED BY client_key, user_name
|
|
CREATE QUOTA q3_01297
|
|
-- intervals
|
|
CREATE QUOTA q1_01297 FOR INTERVAL 5 day MAX errors = 3
|
|
CREATE QUOTA q2_01297 FOR INTERVAL 30 minute MAX errors = 4
|
|
CREATE QUOTA q3_01297 FOR INTERVAL 1 hour MAX errors = 5
|
|
CREATE QUOTA q4_01297 FOR INTERVAL 2000 second MAX errors = 5
|
|
CREATE QUOTA q5_01297 FOR RANDOMIZED INTERVAL 1 year MAX queries = 100, errors = 11
|
|
CREATE QUOTA q6_01297 FOR INTERVAL 2 month MAX queries = 100, errors = 11, result_rows = 1000, result_bytes = 10000, read_rows = 1001, read_bytes = 10001, execution_time = 2.5
|
|
CREATE QUOTA q7_01297 FOR INTERVAL 1 quarter MAX queries = 100, errors = 11
|
|
CREATE QUOTA q8_01297 FOR INTERVAL 2 month MAX result_rows = 1002, FOR INTERVAL 2 quarter MAX queries = 100, errors = 11
|
|
CREATE QUOTA q1_01297
|
|
CREATE QUOTA q2_01297 FOR INTERVAL 30 minute TRACKING ONLY
|
|
CREATE QUOTA q3_01297 FOR INTERVAL 1 hour MAX queries = 70, FOR INTERVAL 2 hour MAX errors = 10
|
|
CREATE QUOTA q4_01297 FOR RANDOMIZED INTERVAL 2000 second MAX errors = 5
|
|
CREATE QUOTA q5_01297 FOR INTERVAL 1 year MAX errors = 111
|
|
-- to roles
|
|
CREATE QUOTA q1_01297
|
|
CREATE QUOTA q2_01297 TO ALL
|
|
CREATE QUOTA q3_01297 TO r1_01297
|
|
CREATE QUOTA q4_01297 TO u1_01297
|
|
CREATE QUOTA q5_01297 TO r1_01297, u1_01297
|
|
CREATE QUOTA q6_01297 TO ALL EXCEPT r1_01297
|
|
CREATE QUOTA q7_01297 TO ALL EXCEPT r1_01297, u1_01297
|
|
CREATE QUOTA q1_01297 TO u1_01297
|
|
CREATE QUOTA q2_01297
|
|
-- multiple quotas in one command
|
|
CREATE QUOTA q1_01297 FOR INTERVAL 1 day MAX errors = 5
|
|
CREATE QUOTA q2_01297 FOR INTERVAL 1 day MAX errors = 5
|
|
CREATE QUOTA q1_01297 FOR INTERVAL 1 day TRACKING ONLY TO r1_01297
|
|
CREATE QUOTA q2_01297 FOR INTERVAL 1 day TRACKING ONLY TO r1_01297
|
|
-- system.quotas
|
|
q1_01297 local directory ['user_name'] [] 0 ['r1_01297'] []
|
|
q2_01297 local directory [] [5259492] 0 ['r1_01297','u1_01297'] []
|
|
q3_01297 local directory ['client_key','user_name'] [5259492,15778476] 0 [] []
|
|
q4_01297 local directory [] [604800] 1 [] ['u1_01297']
|
|
-- system.quota_limits
|
|
q2_01297 5259492 0 100 \N \N 11 1000 10000 1001 10001 2.5
|
|
q3_01297 5259492 0 \N \N \N \N 1002 \N \N \N \N
|
|
q3_01297 15778476 0 100 \N \N 11 \N \N \N \N \N
|
|
q4_01297 604800 0 \N \N \N \N \N \N \N \N \N
|
|
-- query_selects query_inserts
|
|
CREATE QUOTA q1_01297 KEYED BY user_name FOR INTERVAL 1 minute MAX query_selects = 1 TO r1_01297
|
|
CREATE QUOTA q2_01297 KEYED BY user_name FOR INTERVAL 1 minute MAX query_inserts = 1 TO r1_01297
|