v.20.1Experimental Feature
Reworked Access Control Quotas and New SQL Functions Added
Reworked quotas as a part of access control system. Added new tablesystem.quotas, new functionscurrentQuota,currentQuotaKey, new SQL syntaxCREATE QUOTA,ALTER QUOTA,DROP QUOTA,SHOW QUOTA. #7257 (Vitaly Baranov)
Why it matters
This feature improves access control by providing a more flexible and powerful way to manage resource usage limits (quotas) in ClickHouse. It enables users to define, modify, and monitor quotas more easily and precisely, helping prevent resource overuse and ensuring fair usage across users and queries.How to use it
Users can manage quotas using the new SQL commands:CREATE QUOTA to define a quota, ALTER QUOTA to modify an existing quota, DROP QUOTA to remove a quota, and SHOW QUOTA to list quotas. The system.quotas table provides insight into quota configurations, and functions currentQuota() and currentQuotaKey() can be used in queries to retrieve information about the currently applied quota and quota key.