Skip to main content
Last updated on

SHOW WORKLOAD GROUPS

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 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 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:

FieldDescription
IdThe ID of the workload group.
NameThe workload group name.
min_cpu_percentThe minimum guaranteed CPU percentage.
max_cpu_percentThe maximum CPU percentage.
min_memory_percentThe minimum guaranteed memory percentage.
max_memory_percentThe maximum memory percentage.
max_concurrencyThe maximum number of concurrent queries.
max_queue_sizeThe maximum queue length for waiting queries.
queue_timeoutThe maximum queue wait time in milliseconds.
scan_thread_numThe number of local scan threads used by the workload group.
max_remote_scan_thread_numThe maximum number of scan threads for remote data sources.
min_remote_scan_thread_numThe minimum number of scan threads for remote data sources.
memory_low_watermarkThe low memory watermark.
memory_high_watermarkThe high memory watermark.
compute_groupThe 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_secondThe IO throughput limit for reading Doris internal tables, in bytes per second. -1 means unlimited.
remote_read_bytes_per_secondThe IO throughput limit for reading remote data sources, in bytes per second. -1 means unlimited.
slot_memory_policyThe memory allocation policy for query slots.
running_query_numThe number of queries currently running in this workload group.
waiting_query_numThe number of queries currently waiting in this workload group's queue.

Usage Notes

  1. This statement supports only LIKE filtering and does not support a WHERE clause.

  2. This statement is intended for simple display of workload group information. For more complex querying or filtering, use the TVF workload_groups().

  3. Results are filtered by privilege. To view a specific workload group, the user must have USAGE_PRIV on that workload group or have the global ADMIN_PRIV. Example:

    GRANT USAGE_PRIV ON WORKLOAD GROUP 'g1' TO 'user_1'@'%';
  4. In the current implementation, the default workload group normal is usually visible without extra authorization for compatibility reasons.