Amazon Redshift
Database Developer Guide
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.

WLM Queue Assignment Rules

When a user runs a query, WLM assigns the query to the first matching queue, based on the WLM queue assignment rules:

  1. If a user is logged in as a superuser and runs a query in the query group labeled superuser, the query is assigned to the superuser queue.

  2. If a user belongs to a listed user group or runs a query within a listed query group, the query is assigned to the first matching queue.

  3. If a query doesn't meet any criteria, the query is assigned to the default queue, which is the last queue defined in the WLM configuration.

The following diagram illustrates how these rules work.

Queue Assignments Example

The following table shows a WLM configuration with the superuser queue and four user-defined queues.

The following illustration shows how queries are assigned to the queues in the previous table according to user groups and query groups. For information about how to assign queries to user groups and query groups at runtime, see Assigning Queries to Queues later in this section.

In this example, WLM makes the following assignments:

  1. The first set of statements shows three ways to assign users to user groups. The statements are executed by the user masteruser, which is not a member of a user group listed in any WLM queue. No query group is set, so the statements are routed to the default queue.

  2. The user masteruser is a superuser and the query group is set to 'superuser', so the query is assigned to the superuser queue.

  3. The user admin1 is a member of the user group listed in queue 1, so the query is assigned to queue 1.

  4. The user vp1 is not a member of any listed user group. The query group is set to 'QG_B', so the query is assigned to queue 2.

  5. The user analyst1 is a member of the user group listed in queue 3, but 'QG_B' matches queue 2, so the query is assigned to queue 2.

  6. The user ralph is not a member of any listed user group and the query group was reset, so there is no matching queue. The query is assigned to the default queue.