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

WLM Queue Assignment Rules

When a user runs a query, WLM assigns the query to the first matching queue, based on these 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 if a user 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 table shows a WLM configuration with the Superuser queue and four user-defined queues.

Queue Assignments Example

The following example shows how queries are assigned to the queues in the previous example according to user groups and query groups. For information about how to assign queries to user groups and query groups at run time, 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.