Skip to main content
Skip to main content

CREATE QUOTA

Creates a quota that can be assigned to a user or a role.

Syntax:

Keys user_name, ip_address, client_key, client_key, user_name and client_key, ip_address correspond to the fields in the system.quotas table.

Parameters queries, query_selects, query_inserts, errors, result_rows, result_bytes, read_rows, read_bytes, execution_time, failed_sequential_authentications correspond to the fields in the system.quotas_usage table.

ON CLUSTER clause allows creating quotas on a cluster, see Distributed DDL.

Examples

Limit the maximum number of queries for the current user with 123 queries in 15 months constraint:

For the default user limit the maximum execution time with half a second in 30 minutes, and limit the maximum number of queries with 321 and the maximum number of errors with 10 in 5 quarters:

Further examples, using the xml configuration (not supported in ClickHouse Cloud), can be found in the Quotas guide.

Try ClickHouse Cloud for FREE

Separation of storage and compute, automatic scaling, built-in SQL console, and lots more. $300 in free credits when signing up.

Try it for Free