Adaptive workload manager admission queue order

To implement its admission control capabilities, the adaptive workload manager maintains an admission queue. This queue contains all queries that are waiting to begin execution.

The admission queue is multilevel, which reflects the superclasses, subclasses within superclasses, and the individual requests within subclasses. The admission queue is constantly rebalanced based on the most under-served service class relative to its entitlement, with the request at the head of the most under-served service class being placed at the head of the admission queue.

Within a service subclass, requests can be queued in one of the following orders:
FIFO
Requests are queued in a first in, first out order, such that the requests that arrived earlier are executed earlier. This is the default.
Latency
Requests are queued based on estimated execution time relative to queue time. This ordering gives priority to shorter requests, with the queue time component avoiding perpetual starvation of requests.

The admission queue order for a service subclass is specified using the ADMISSION QUEUE ORDER clause on a CREATE or ALTER SERVICE CLASS statement. The ADMISSION QUEUE ORDER clause is not valid for a service superclass. Subclasses within a superclass are always ordered based on their resource usage over time relative to their resource entitlements, that is, the most under-served service class is first in the queue.