The parallel query option can dramatically improve performance for data-intensive operations associated with decision support applications or very large database environments. Symmetric multiprocessing (SMP), clustered, or massively parallel systems gain the largest performance benefits from the parallel query option because query processing can be effectively split up among many CPUs on a single system.
It is important to note that the query is parallelized dynamically at execution time. Thus, if the distribution or location of the data changes, Oracle automatically adapts to optimize the parallelization for each execution of a SQL statement.
The parallel query option helps systems scale in performance when adding hardware resources. If your system's CPUs and disk controllers are already heavily loaded, you need to alleviate the system's load before using the parallel query option to improve performance. The section "Tuning for the Parallel Query Option" describes how your system can achieve the best performance with the parallel query option.
The Oracle Server can use parallel query processing for any of these statements:
Figure 6 - 1. Full Table Scan without the Parallel Query Option
The parallel query option allows certain operations (for example, full table scans or sorts) to be performed in parallel by multiple query server processes. One process, known as the query coordinator, dispatches the execution of a statement to several query servers and coordinates the results from all of the servers to send the results back to the user. Figure 6 - 2 illustrates several query server processes simultaneously performing a partial scan of the EMP table. The results are then sent back to the query coordinator, which assembles the pieces into the desired full table scan.
Figure 6 - 2. Multiple Query Servers Performing a Full Table Scan in Parallel
Figure 6 - 3 illustrates creating a table from a subquery in parallel.
Figure 6 - 3. Creating a Summary Table in Parallel
If you disable recoverability during parallel table creation, you should take a backup of the tablespace containing the table once the table is created to avoid loss of the table due to media failure. For more information about recoverability of tables created in parallel, see the Oracle7 Server Administrator's Guide.
Clustered tables cannot be created and populated in parallel.
For a discussion of the syntax of the CREATE TABLE command, see the Oracle7 Server SQL Reference.
When creating a table in parallel, each of the query server processes uses the values in the STORAGE clause. Therefore, a table created with an INITIAL of 5M and a PARALLEL DEGREE of 12 consumes at least 60M of storage during table creation because each process starts with an extent of 5M. When the query coordinator process combines the extents, some of the extents may be trimmed, and the resulting table may be smaller than the requested 60M.
For more information on how extents are allocated when using the parallel query option, see Oracle7 Server Concepts.