Database Reference
In-Depth Information
PX, which is a background process, does most of the work for a PQ. PX is allocated in slave sets, which act as either
producers or consumers. The number of slave sets required to complete the operation is determined based on the
complex nature of the query, the amount of resources available, and parallel degree limit defined. For a simple query
SELECT /*+ PARALLEL (PRODUCT, 2) */ * FROM PRODUCT
Only one slave set can be used to scan the table (see Figure 8-2 ). These sets of slaves act as producers.
User process
Query Coordinator
PX Slave
PX Slave
Database Table
Figure 8-2. Parallel query slaves
However, if the query is of a more complex nature, such as a multi-table join or has a ORDER BY or GROUP BY
operation, then probably more than one slave set (illustrated in Figure 8-3 ) would be used; and, in this scenario, the
slaves act in both the producer and consumer roles. When acting as producers, slaves are making data available to the
next step (using the table queues). When acting as consumers, slaves are taking data from a previous table queue and
performing operations on it.
Query Coordinator
User process
PX Slave 0
PX Slave 1
Sort
PX Slave 2
PX Slave 3
Scan
Database Table
Figure 8-3. Parallel processing with sort operation
 
Search WWH ::




Custom Search