TQ (Table queue) node

This node represents a table queue.

Node name: TQ

Represents: A table queue that is used to pass table data from one database agent to another when there are multiple database agents processing a query. Multiple database agents are used to process a query when parallelism is involved.

Table queue types are:
  • Local: The table queue is used to pass data between database agents within a single node. A local table queue is used for intra-partition parallelism.
  • Non-Local: The table queue is used to pass data between database agents on different nodes.

Based on the origin type, TQ nodes are of two types:

  1. ATQ - Asynchronous TQ node
  2. XTQ - XML aggregation TQ Node

The XTQ node is a table queue that constructs a XML sequence from XML documents stored on database partitions.

For example, assume US_ORDERS is a partitioned table residing on several database partitions and US_ORDERS.DETAILS is the XML column. The following XQuery statement returns all orders whenever the total number of products sold exceeds more than 100.
Note: XQuery is supported by Visual Explain only.
Xquery let $all_orders := db2-fn:xmlcolumn('US_ORDERS.DETAILS')
where
sum($all_orders//product/qty) > 100
return
$all_orders
For the XQuery statement, the db2exfmt command produces the following access plan output that contains an XTQ node. In the plan output, references to all the XML documents stored in US_ORDERS.DETAILS column are routed (DTQ: Directed TQ) to the coordinator partition and aggregated into a global sequence, later each item in the global sequence is routed back to its original partition for navigation and the results are aggregated together into a new output global sequence (XTQ: XSCAN related TQ).
            Rows 
           RETURN
           (   1)
            Cost 
            I/O 
             |
             1 
           NLJOIN
           (   2)
            98.171 
              8 
            /-+-\
        1         2000 
     FILTER        XTQ   
     (   3)       (   7)
     37.4289      60.7421 
        1           7 
        |           |
        1          0.5 
     GRPBY        XSCAN 
     (   4)       (   8)
     37.3755       57.2 
        1            7 
        |
       360 
       DTQ   
     (   5)
     33.7655 
        1 
        |
       180 
     TBSCAN
     (   6)
     22.051 
        1 
        |
       180 
 TABLE: USER1
    US_ORDERS

Feedback