Question: What does the
parallel_index hint do?
Answer: The parallel_index hint is effective only on
partitioned indexes and only when the range scans are being performed,
AND ONLY when partitioned indexes are defined for the table.
The single most common mistake with parallel_index
hint is using it against a non-partitioned index, where it will be
ignored.
The parallel_index hint specifies the
desired number of concurrent servers that can be used to parallelize
index range scans for partitioned indexes.
When using the parallel_index hint,
specifying DEFAULT or no DEGREE value tells the query coordinator check
the initialization parameter default degree of parallelism (parallel_automatic_tuning).
/*+ PARALLEL_INDEX([@queryblock] <tablespec>
<index_name> <degreee | DEFAULT>) */
Here is an example of invoking the parallel_index
hint:
SELECT /*+
PARALLEL_INDEX(mytab, myindex, 3) */ stuff FROM mytab;
Using the default DEGREE with parallel_index
If you are using an SMP or MPP database server with
many CPUs, you can issue a parallel request and leave it up to each
Oracle instance to use its default degree of parallelism. For example,
consider the following parallel_index query:
SELECT /*+
PARALLEL_INDEX(emp, type_idx, 31) */
employee_name
from
emp
where
emp_type = 'SALARIED';
Oracle also provides the
parallel_automatic_tuning init.ora parameter to assist in setting
the best degree of parallelism. When setting
parallel_automatic_tuning, you only need to specify parallelism for
a table, and Oracle will dynamically change the
parallel_adaptive_multi_user parameter to override the execution
plan in favor of maintaining an acceptable overall load on the database.
WARNING:
The parallel_automatic_tuning parameter is not always
appropriate for OLTP and online systems, where setting
parallel_automatic_tuning may change the SQL optimizers perception
of the costs of full scan operations, causing indexes not to be used.