Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

CHANGE_QUERY_PRIORITY - Amazon Redshift

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. Requires an INTEGER value.

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

Examples

To show the column query_priority in the STV_WLM_QUERY_STATE system table, use the following example.

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

To show the results of a superuser running the function change_query_priority to change the priority to CRITICAL, use the following example.

SELECT CHANGE_QUERY_PRIORITY(1076, 'Critical'); +-------------------------------------------------------------------------------+ | change_query_priority | +-------------------------------------------------------------------------------+ | Succeeded to change query priority. Priority changed from Lowest to Critical. | +-------------------------------------------------------------------------------+
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.