Zurab Kiknavelidze
06/19/2026, 1:56 PMRocky
06/19/2026, 1:56 PMTO clause when creating the group:
sql
CREATE RESOURCE GROUP rg1
TO
(user='alice'), -- Matches user 'alice'
(role='analyst') -- Matches any user with the 'analyst' role
WITH (
'cpu_weight' = '10',
'mem_limit' = '20%'
);
2. Add or Remove Users from an Existing Group
If the resource group already exists, use ALTER RESOURCE GROUP to manage its classifiers:
* Add a user:
sql
ALTER RESOURCE GROUP rg1 ADD (user='bob');
* Remove a user:
First, find the classifier_id using SHOW RESOURCE GROUP rg1;, then drop it:
sql
ALTER RESOURCE GROUP rg1 DROP (10001);
3. Manual Override (Session Level)
A user can also manually switch to a specific resource group for their current session or a specific query:
* Session level:
sql
SET resource_group = 'rg1';
* Query level (Hint):
sql
SELECT /_+ SET_VAR(resource_group = 'rg1') _/ * FROM table_name;
4. Verify Assignments
To see which users and conditions are mapped to which resource groups, use:
sql
-- View all resource groups and their classifiers (users/roles/IPs)
SHOW RESOURCE GROUPS ALL;
-- View the resource group used by a specific query
-- Check the 'ResourceGroup' column in the FE audit log or run:
EXPLAIN VERBOSE <your_query>;
How Matching Works
If a user matches multiple resource groups, StarRocks uses a matching degree system:
* An exact user match is generally high priority.
* If multiple classifiers match (e.g., one by user and one by role), the one with the most specific conditions (the highest matching degree) is chosen.
References
• administration/management/resource_management/resource_group.md
• faq/resource_isolation_faq.mdZurab Kiknavelidze
06/19/2026, 1:57 PMRocky
06/19/2026, 1:57 PMsql
SHOW RESOURCE GROUPS ALL;
How to read the output:
Look at the classifiers column. It lists the conditions that route a user to that group. For example:
* (id=15016, weight=1.0, user=alice) means user alice is mapped to this group.
* (id=15017, weight=1.0, role=analyst) means anyone with the analyst role is mapped here.
2. View mappings for your current user
To see which resource group you (the logged-in user) are currently hitting based on the existing rules:
sql
SHOW RESOURCE GROUPS;
3. Check a specific group
If you want to see who is assigned to a specific group (e.g., rg1):
sql
SHOW RESOURCE GROUP rg1;
Important Note on "Belonging"
In StarRocks, a user doesn't strictly "belong" to one group. Instead, queries are matched to groups based on classifiers.
* If a user matches multiple groups, the one with the highest weight (the most specific match) is used.
* If no specific match is found, the user falls into the default_wg (default resource group).
References
• administration/management/resource_management/resource_group.md
• sql-reference/sql-statements/cluster-management/resource_group/SHOW_RESOURCE_GROUP.md
References
• administration/management/resource_management/resource_group.md
• sql-reference/sql-statements/cluster-management/resource_group/SHOW_RESOURCE_GROUP.md
• faq/resource_isolation_faq.md