Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

STV_WLM_SERVICE_CLASS_CONFIG

Records the service class configurations for WLM.

STV_WLM_SERVICE_CLASS_CONFIG is visible only to superusers. For more information, see Visibility of Data in System Tables and Views.

Table Columns

Column Name Data Type Description
service_class integer ID for the service class. Service classes 1-4 are reserved for system use. Service class 5 is reserved for the superuser queue. Service classes 6 and greater are defined in the WLM configuration
queueing_strategy character(32) Reserved for system use.
num_query_tasks integer Current actual concurrency level of the service class. If num_query_tasks and target_num_query_tasks are different, a dynamic WLM transition is in process.
target_num_query_tasks integer Concurrency level set by the most recent WLM configuration change.
evictable character(8) Reserved for system use.
eviction_threshold bigint Reserved for system use.
query_working_mem integer Current actual amount of working memory, in MB per slot, assigned to the service class. If query_working_mem and target_query_working_mem are different, a dynamic WLM transition is in process.
target_query_working_mem integer The amount of working memory, in MB per slot, set by the most recent WLM configuration change.
min_step_mem integer Reserved for system use.
name character(64) Description of the service class.
max_execution_time bigint Number of milliseconds that the query can execute before being terminated.
user_group_wild_card Boolean If TRUE, the WLM queue treats an asterisk (*) as a wildcard character in user group strings in the WLM configuration.
query_group_wild_card Boolean If TRUE, the WLM queue treats an asterisk (*) as a wildcard character in query group strings in the WLM configuration.

Sample Query

Service classes 1 - 4 are used internally by Amazon Redshift, and service class 5 is reserved for the dedicated superuser queue. The first user-defined service class is service class 6, which is named Service class #1. The following query displays the current configuration for service classes greater than 4, which are the WLM query queues.

Copy
select rtrim(name) as name, num_query_tasks as slots, query_working_mem as mem, max_execution_time as max_time, user_group_wild_card as user_wildcard, query_group_wild_card as query_wildcard from stv_wlm_service_class_config where service_class > 4; name | slots | mem | max_time | user_wildcard | query_wildcard -----------------------------+-------+-----+----------+---------------+--------------- Service class for super user | 1 | 535 | 0 | false | false Service class #1 | 5 | 125 | 0 | false | false Service class #2 | 5 | 125 | 0 | false | false Service class #3 | 5 | 125 | 0 | false | false Service class #4 | 5 | 627 | 0 | false | false Service class #5 | 5 | 125 | 0 | true | true Service class #6 | 5 | 125 | 0 | false | false (6 rows)

The following query shows the status of a dynamic WLM transition. While the transition is in process, num_query_tasks and target_query_working_mem are updated until they equal the target values. For more information, see WLM Dynamic and Static Configuration Properties.

Copy
select rtrim(name) as name, num_query_tasks as slots, target_num_query_tasks as target_slots, query_working_mem as memory, target_query_working_mem as target_memory from stv_wlm_service_class_config where num_query_tasks > target_num_query_tasks or query_working_mem > target_query_working_mem and service_class > 5; name | slots | target_slots | memory | target_mem ------------------+-------+--------------+--------+------------ Service class #3 | 5 | 15 | 125 | 375 Service class #5 | 10 | 5 | 250 | 125 (2 rows)

On this page: