Settings-profile statements
Assign workload and concurrency settings to database roles.
Settings-profile statements
This page describes statements accepted by the Query API in RawTree Cloud and RawTree BYOC. Its restrictions apply to the API, not to all RawTree SQL. See ClickHouse compatibility and API scope.
Syntax
CREATE SETTINGS PROFILE [OR REPLACE | IF NOT EXISTS] <name>
[ON CLUSTER 'default']
SETTINGS workload = '<name>' [READONLY | CONST]
[, use_concurrency_control = 0|1 [READONLY | CONST]]
TO <existing role>, ...
DROP SETTINGS PROFILE [IF EXISTS] <name> [ON CLUSTER 'default']Clauses
| Clause | Meaning |
|---|---|
workload | Set a role's default workload. |
use_concurrency_control | Enable or disable concurrency control. |
READONLY | Apply the profile's setting as read-only. |
CONST | Prevent the role from overriding the setting. |
TO | Attach the profile to existing roles. |
Query API behavior
- Supported:
workloadanduse_concurrency_control, withREADONLYorCONST, for existing roles. Access storage controls profile replication. - Not exposed by the Query API:
ALTER SETTINGS PROFILE, other profile settings, inheritance, user targets, and clusters other thandefault. - Query API scope: This API supports one profile statement per request and only its two scheduling settings.
Errors
Error: Unsupported settings profile statement.
Hint:
Use CREATE SETTINGS PROFILE [OR REPLACE | IF NOT EXISTS] <name> SETTINGS workload = '<name>' and/or use_concurrency_control = 0/1, optionally READONLY or CONST, TO <existing roles>; or DROP SETTINGS PROFILE [IF EXISTS] <name>. Only ON CLUSTER 'default' is supported. Submit one statement.Examples
Create a role for the profile.
CREATE ROLE profile_statement_analystCreate the workload that the profile assigns.
CREATE WORKLOAD profile_statement_workload ON CLUSTER 'default'Assign the workload and prevent overrides.
CREATE SETTINGS PROFILE profile_statement_profile SETTINGS workload = 'profile_statement_workload' CONST TO profile_statement_analystDrop the profile before the role.
DROP SETTINGS PROFILE IF EXISTS profile_statement_profileDROP ROLE IF EXISTS profile_statement_analystDrop the workload after the profile.
DROP WORKLOAD IF EXISTS profile_statement_workload ON CLUSTER 'default'The parser rejects ALTER SETTINGS PROFILE.
ALTER SETTINGS PROFILE profile_statement_profile SETTINGS workload = 'default'The parser rejects settings other than the supported scheduling settings.
CREATE SETTINGS PROFILE restricted_profile SETTINGS max_memory_usage = 1 TO profile_statement_analystThe parser rejects profile inheritance.
CREATE SETTINGS PROFILE restricted_profile IN profile_statement_profile SETTINGS workload = 'default' TO profile_statement_analystThe parser rejects user targets.
CREATE SETTINGS PROFILE restricted_profile SETTINGS workload = 'default' TO USER analytics_userThe parser rejects other clusters.
CREATE SETTINGS PROFILE restricted_profile ON CLUSTER 'other' SETTINGS workload = 'default' TO profile_statement_analyst