Queue
The Queue is a temporary object that allows the optimizer to feed the recursion of a recursive query by putting on the queue those data values needed for the recursion. This data typically includes those values used on the recursive join predicate and other recursive data being accumulated or manipulated during the recursive process.
The Queue has two operations allowed:
- Enqueue: puts data on the queue
- Dequeue: takes data off the queue
A queue is an efficient data structure because it contains only that data needed to feed the recursion or directly modified by the recursion process and its size is managed by the optimizer.
Unlike other temporary objects created by the optimizer, the queue is not populated in all at once by the underlying query node tree but is really a real time temporary holding area for values feeding the recursion. In this regard, a queue is not considered temporary as it will not prevent the query from running if ALWCPYDTA(*NO) was specified, because the data can still being flowing up and out of the query at the same time the recursive values are inserted into the queue to be used to retrieve additional join rows.
A queue is an internal data structure and can only be created by the database manager.
Visual explain icon:
- Enqueue
During a enqueue operation, an entry it put on the queue that contains key values used by the recursive join predicates or data manipulated as a part of the recursion process. The optimizer always supplies an enqueue operation to collect the required recursive data on the query node directly above the Union All.
- Dequeue
During a dequeue operation, an entry is taken off the queue and those values specified by recursive reference are fed back in to the recursive join process.
Parent topic:
Temporary objects and access methods