📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

Workload Group



Workload groups enable resource management and query concurrency control in TiDB Cloud Lake by allocating CPU, memory quotas and limiting concurrent queries for different user groups.

How It Works

  1. Create workload groups with specific resource quotas (CPU, memory, concurrency limits)
  2. Assign users to workload groups using ALTER USER
  3. Query execution automatically applies the workload group's resource limits based on the user

Quick Example

-- Create workload group CREATE WORKLOAD GROUP analytics WITH cpu_quota = '50%', memory_quota = '30%', max_concurrency = 5; -- Create role and grant permissions CREATE ROLE analyst_role; GRANT ALL ON *.* TO ROLE analyst_role; CREATE USER analyst IDENTIFIED BY 'password' WITH DEFAULT_ROLE = 'analyst_role'; GRANT ROLE analyst_role TO analyst; -- Assign user to workload group ALTER USER analyst WITH SET WORKLOAD GROUP = 'analytics'; -- Remove user from workload group (user will use default unlimited resources) ALTER USER analyst WITH UNSET WORKLOAD GROUP;

Command Reference

Management

CommandDescription
CREATE WORKLOAD GROUPCreates a new workload group with resource quotas
ALTER WORKLOAD GROUPModifies workload group configuration
DROP WORKLOAD GROUPRemoves a workload group
RENAME WORKLOAD GROUPRenames a workload group

Information

CommandDescription
SHOW WORKLOAD GROUPSLists all workload groups and their settings

Was this page helpful?