Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
469841 consistent gets
313226 physical reads
0 redo size
425 bytes sent via SQL*Net to client
415 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
parallel_degree_policy设置为limited
对某些语句启用自动并行度,但statement queuing与in-memory parallel execution被禁用。只会对访问使用parallel子句来设置DEFAULT并行度的表或索引应用自动并行度。
SQL> select degree,instances from user_tables where table_name = 'T1';
DEGREE INSTANCES
-------------------- --------------------
1 1
SQL> show parameter parallel_degree_policy
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
parallel_degree_policy string LIMITED
SQL> set autotrace on;
SQL> select count(*) from t1;
COUNT(*)
----------
22040576
Execution Plan
----------------------------------------------------------
Plan hash value: 3724264953
-------------------------------------------------------------------
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
-------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 84998 (1)| 00:00:06 |
| 1 | SORT AGGREGATE | | 1 | | |
| 2 | TABLE ACCESS FULL| T1 | 21M| 84998 (1)| 00:00:06 |
-------------------------------------------------------------------
Note
-----
- dynamic sampling used for this statement (level=2)
Statistics
----------------------------------------------------------
5 recursive calls
0 db block gets
469898 consistent gets
313399 physical reads
0 redo size
425 bytes sent via SQL*Net to client
415 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
因为表的并行度是1,而不是default,现在使用parallel子句来修改表t1的并行度
SQL> alter table t1 parallel;
Table altered.
SQL> select degree,instances from user_tables where table_name = 'T1';
DEGREE INSTANCES
-------------------- --------------------
DEFAULT DEFAULT
SQL> set autotrace on
SQL> select count(*) from t1;
COUNT(*)
----------
22040576
Execution Plan
----------------------------------------------------------
Plan hash value: 3110199320