ClickHouse/tests/queries/0_stateless/01297_create_quota.reference

64 lines
2.8 KiB
Plaintext
Raw Normal View History

2020-06-01 21:43:16 +00:00
-- 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 disk ['user_name'] [] 0 ['r1_01297'] []
q2_01297 disk [] [5259492] 0 ['r1_01297','u1_01297'] []
q3_01297 disk ['client_key','user_name'] [5259492,15778476] 0 [] []
q4_01297 disk [] [604800] 1 [] ['u1_01297']
-- system.quota_limits
q2_01297 5259492 0 100 11 1000 10000 1001 10001 2.5
q3_01297 5259492 0 \N \N 1002 \N \N \N \N
q3_01297 15778476 0 100 11 \N \N \N \N \N
q4_01297 604800 0 \N \N \N \N \N \N \N