CHANGE_QUERY_PRIORITY - Amazon Redshift
AWS services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with AWS services in China.

CHANGE_QUERY_PRIORITY

CHANGE_QUERY_PRIORITY enables superusers to modify the priority of a query that is either running or waiting in workload management (WLM).

This function enables superusers to immediately change the priority of any query in the system. Only one query, user, or session can run with the priority CRITICAL.

Syntax

CHANGE_QUERY_PRIORITY(query_id, priority)

Arguments

query_id

The query identifier of the query whose priority is changed.

priority

The new priority to be assigned to the query. This argument must be a string with the value CRITICAL, HIGHEST, HIGH, NORMAL, LOW, or LOWEST.

Return Type

None

Example

The following example shows the column query_priority in the STV_WLM_QUERY_STATE system table.

select query, service_class, query_priority, state from stv_wlm_query_state where service_class = 101; query | service_class | query_priority | state -------+---------------+----------------------+------------------ 1076 | 101 | Lowest | Running 1075 | 101 | Lowest | Running (2 rows)

The following example shows the results of a superuser running the function change_query_priority to change the priority to CRITICAL.

select change_query_priority(1076, 'Critical'); change_query_priority -------------------------------------------------- Succeeded to change query priority. Priority changed from Lowest to Critical. (1 row)