For AI agents: the complete documentation index is at llms.txt. Every page is also available as markdown by appending .md to its URL, or by sending an Accept: text/markdown request header.

ALTER GROUP SET RESOURCE GROUP reference

Enterprise:

Resource groups isolate competing query workloads inside a single QuestDB instance.

ALTER GROUP ... SET RESOURCE GROUP places the queries of every user in the group under a resource group, which governs their admission, CPU share and memory budget.


Syntax​

ALTER GROUP groupName SET RESOURCE GROUP resourceGroupName
[MAPPING PRIORITY priority];

Description​

Mapping an ACL group is how you cover a team without naming each member. It requires the RESOURCE GROUP ADMIN permission, and affects queries that start after the change rather than one already running.

This is workload mapping: it decides how much of the instance the group's queries may consume. It is unrelated to WITH EXTERNAL ALIAS, which decides which QuestDB group an external identity lands in.

MAPPING PRIORITY​

A user can belong to several ACL groups, so each ACL group mapping carries a priority and the highest one wins. MAPPING PRIORITY is a non-negative integer that defaults to 0.

If two carry the same priority, the tie falls to whichever resource group was created first. That is rarely intended, so give them distinct priorities when the order matters.

The clause is accepted only here. It is rejected on ALTER USER and ALTER SERVICE ACCOUNT, which are one-to-one and have nothing to break a tie between.

A direct mapping on a user beats every ACL group mapping regardless of priority.

Examples​

-- every member's queries run under the adhoc workload policy
ALTER GROUP analysts SET RESOURCE GROUP adhoc MAPPING PRIORITY 10;
-- oncall wins for anyone who is in both groups
ALTER GROUP oncall SET RESOURCE GROUP dashboards MAPPING PRIORITY 20;

Verify with SHOW GROUPS, which reports the mapping in its resource_group and resource_group_priority columns:

SELECT name, resource_group, resource_group_priority FROM (SHOW GROUPS);
nameresource_groupresource_group_priority
analystsadhoc10
oncalldashboards20

Both columns are null for a group that is not mapped.

See also​