ALTER SERVICE ACCOUNT SET RESOURCE GROUP reference
Resource groups isolate competing query workloads inside a single QuestDB instance.
ALTER SERVICE ACCOUNT ... SET RESOURCE GROUP places the service account's
queries under a resource group, which governs
their admission, CPU share and memory budget.
Syntax
ALTER SERVICE ACCOUNT serviceAccountName SET RESOURCE GROUP resourceGroupName;
Description
A session that assumes the service account keeps the resource group of the principal that logged in. The account's own mapping applies to sessions that authenticate as it.
MAPPING PRIORITY is not accepted here, because a service account has
exactly one mapping and there is nothing to break a tie between. It belongs to
ALTER GROUP SET RESOURCE GROUP.
The statement requires the
RESOURCE GROUP ADMIN permission, and affects
queries that start after the change rather than one already running.
This governs the queries the account runs. It does not throttle ingestion, which resource groups do not manage.
Examples
ALTER SERVICE ACCOUNT client_app SET RESOURCE GROUP automation;
Verify with
SHOW SERVICE ACCOUNTS, which
reports the mapping in its resource_group column:
SELECT name, resource_group FROM (SHOW SERVICE ACCOUNTS);
| name | resource_group |
|---|---|
| client_app | automation |