SHOW WORKLOAD GROUPS
Note:
In these SQL statements, a compute group corresponds to a warehouse cluster. Use the explicit cluster binding required by VeloDB Cloud. Non-cloud examples describe upstream compatibility and do not select a Cloud cluster. See Workload Groups for current properties and permissions.
Description
This statement displays the workload groups that the current user is allowed to view. You can use LIKE for name-based pattern matching. To view a specific workload group, the user must have USAGE_PRIV on that workload group or have the global ADMIN_PRIV.
Syntax
SHOW WORKLOAD GROUPS [LIKE "<pattern>"];
Examples
Example 1: show all workload groups
show all workload groups
SHOW WORKLOAD GROUPS;
mysql> show workload groups \G;
*************************** 1. row ***************************
Id: 1754728930516
Name: normal
min_cpu_percent: 20%
max_cpu_percent: 30%
min_memory_percent: 0%
max_memory_percent: 50%
max_concurrency: 1
max_queue_size: 1
queue_timeout: 0
scan_thread_num: 16
max_remote_scan_thread_num: -1
min_remote_scan_thread_num: -1
memory_low_watermark: 75%
memory_high_watermark: 85%
compute_group: default
read_bytes_per_second: -1
remote_read_bytes_per_second: -1
slot_memory_policy: none
running_query_num: 0
waiting_query_num: 0
*************************** 2. row ***************************
Id: 1754740507946
Name: test_group2
min_cpu_percent: 10%
max_cpu_percent: 30%
min_memory_percent: 0%
max_memory_percent: 3%
max_concurrency: 2147483647
max_queue_size: 0
queue_timeout: 0
scan_thread_num: -1
max_remote_scan_thread_num: -1
min_remote_scan_thread_num: -1
memory_low_watermark: 75%
memory_high_watermark: 85%
compute_group: default
read_bytes_per_second: -1
remote_read_bytes_per_second: -1
slot_memory_policy: none
running_query_num: 0
waiting_query_num: 0
Example 2: show workload groups using a pattern
show workload groups using a pattern
SHOW WORKLOAD GROUPS LIKE "normal%";
mysql> show workload groups like "normal%" \G;
*************************** 1. row ***************************
Id: 1754728930516
Name: normal
min_cpu_percent: 20%
max_cpu_percent: 30%
min_memory_percent: 0%
max_memory_percent: 50%
max_concurrency: 1
max_queue_size: 1
queue_timeout: 0
scan_thread_num: 16
max_remote_scan_thread_num: -1
min_remote_scan_thread_num: -1
memory_low_watermark: 75%
memory_high_watermark: 85%
compute_group: default
read_bytes_per_second: -1
remote_read_bytes_per_second: -1
slot_memory_policy: none
running_query_num: 0
waiting_query_num: 0
Field descriptions
This statement returns the workload groups visible to the current user. Common output fields are described below:
| Field | Description |
|---|---|
Id | The ID of the workload group. |
Name | The workload group name. |
min_cpu_percent | The configured minimum CPU percentage for group resource control. It is not a query latency or throughput guarantee. |
max_cpu_percent | The maximum CPU percentage. |
min_memory_percent | The configured minimum memory percentage relative to the backend process memory budget. |
max_memory_percent | The maximum memory percentage. |
max_concurrency | The maximum admitted query slots. Queries can consume more than one slot. |
max_queue_size | The maximum queue length for waiting queries. |
queue_timeout | The queue timeout in milliseconds. A value of 0 uses the query timeout. |
scan_thread_num | The number of local scan threads used by the workload group. |
max_remote_scan_thread_num | The maximum number of scan threads for remote data sources. |
min_remote_scan_thread_num | The minimum number of scan threads for remote data sources. |
memory_low_watermark | The low memory watermark. |
memory_high_watermark | The high memory watermark. |
compute_group | The compute group to which the workload group belongs. In non-cloud mode, this usually shows the default resource group/tag, such as default. |
read_bytes_per_second | The local read limit per controlled data directory in bytes per second, including applicable spill I/O. -1 means unlimited. |
remote_read_bytes_per_second | The remote read limit per backend workload group, in bytes per second. -1 means unlimited. |
slot_memory_policy | The memory allocation policy for query slots. |
running_query_num | The number of queries currently running in this workload group. |
waiting_query_num | The number of queries currently waiting in this workload group's queue. |
Usage notes
-
This statement supports only
LIKEfiltering and does not support aWHEREclause. -
This statement is intended for simple display of workload group information. For more complex querying or filtering, use the TVF
workload_groups(). -
Results are filtered by privilege. To view a specific workload group, the user must have
USAGE_PRIVon that workload group or have the globalADMIN_PRIV. Example:GRANT USAGE_PRIV ON WORKLOAD GROUP 'g1' TO 'user_1'@'%'; -
In the current implementation, the default workload group
normalis usually visible without extra authorization for compatibility reasons.