- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
2#
发表于 2012-6-16 12:10:47
ODM TEST:- SQL> show parameter parallel
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- fast_start_parallel_rollback string LOW
- parallel_adaptive_multi_user boolean TRUE
- parallel_automatic_tuning boolean FALSE
- parallel_degree_limit string CPU
- parallel_degree_policy string MANUAL
- parallel_execution_message_size integer 16384
- parallel_force_local boolean FALSE
- parallel_instance_group string
- parallel_io_cap_enabled boolean FALSE
- parallel_max_servers integer 80
- parallel_min_percent integer 0
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- parallel_min_servers integer 0
- parallel_min_time_threshold string AUTO
- parallel_server boolean FALSE
- parallel_server_instances integer 1
- parallel_servers_target integer 32
- parallel_threads_per_cpu integer 2
- recovery_parallelism integer 0
- SQL>
- SQL> alter system set parallel_degree_policy=AUTO;
- System altered.
- SQL>
- SQL>
- SQL>
- SQL>
- SQL> alter system set parallel_min_time_threshold=10;
- System altered.
- SQL> conn sh/sh
- Connected.
- SQL> set autot traceonly exp
- SQL> select sum(a.amount_sold) from sales a,sales b,sales c;
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 3928812053
- ---------------------------------------------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
- ---------------------------------------------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 1 | 5 | 22T (1)|999:59:59 | | |
- | 1 | SORT AGGREGATE | | 1 | 5 | | | | |
- | 2 | MERGE JOIN CARTESIAN | | 775P| 3445P| 22T (1)|999:59:59 | | |
- | 3 | MERGE JOIN CARTESIAN | | 844G| 3931G| 24M (1)| 82:43:36 | | |
- | 4 | PARTITION RANGE ALL | | 918K| 4486K| 530 (3)| 00:00:07 | 1 | 28 |
- | 5 | TABLE ACCESS FULL | SALES | 918K| 4486K| 530 (3)| 00:00:07 | 1 | 28 |
- | 6 | BUFFER SORT | | 918K| | 24M (1)| 82:43:30 | | |
- | 7 | PARTITION RANGE ALL | | 918K| | 27 (0)| 00:00:01 | 1 | 28 |
- | 8 | BITMAP CONVERSION TO ROWIDS | | 918K| | 27 (0)| 00:00:01 | | |
- | 9 | BITMAP INDEX FAST FULL SCAN| SALES_PROMO_BIX | | | | | 1 | 28 |
- | 10 | BUFFER SORT | | 918K| | 22T (1)|999:59:59 | | |
- | 11 | PARTITION RANGE ALL | | 918K| | 27 (0)| 00:00:01 | 1 | 28 |
- | 12 | BITMAP CONVERSION TO ROWIDS | | 918K| | 27 (0)| 00:00:01 | | |
- | 13 | BITMAP INDEX FAST FULL SCAN | SALES_PROMO_BIX | | | | | 1 | 28 |
- ---------------------------------------------------------------------------------------------------------------------
- Note
- -----
- - automatic DOP: skipped because of IO calibrate statistics are missing
-
-
-
- GATHER IO calibrate STATISTICS
-
-
-
- set serveroutput on;
- DECLARE
- lat INTEGER;
- iops INTEGER;
- mbps INTEGER;
- BEGIN
- -- DBMS_RESOURCE_MANAGER.CALIBRATE_IO (disk_count,max_latency , iops, mbps, lat);
- DBMS_RESOURCE_MANAGER.CALIBRATE_IO (2, 15, iops, mbps, lat);
-
- DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
- DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
- dbms_output.put_line('max_mbps = ' || mbps);
- end;
- /
-
- max_iops = 78
- latency = 12
- max_mbps = 49
-
-
- SQL> select sum(a.amount_sold) from sales a,sales b,sales c;
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 3928812053
- ---------------------------------------------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
- ---------------------------------------------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 1 | 5 | 22T (1)|999:59:59 | | |
- | 1 | SORT AGGREGATE | | 1 | 5 | | | | |
- | 2 | MERGE JOIN CARTESIAN | | 775P| 3445P| 22T (1)|999:59:59 | | |
- | 3 | MERGE JOIN CARTESIAN | | 844G| 3931G| 24M (1)| 00:48:58 | | |
- | 4 | PARTITION RANGE ALL | | 918K| 4486K| 530 (3)| 00:00:01 | 1 | 28 |
- | 5 | TABLE ACCESS FULL | SALES | 918K| 4486K| 530 (3)| 00:00:01 | 1 | 28 |
- | 6 | BUFFER SORT | | 918K| | 24M (1)| 00:48:58 | | |
- | 7 | PARTITION RANGE ALL | | 918K| | 27 (0)| 00:00:01 | 1 | 28 |
- | 8 | BITMAP CONVERSION TO ROWIDS | | 918K| | 27 (0)| 00:00:01 | | |
- | 9 | BITMAP INDEX FAST FULL SCAN| SALES_PROMO_BIX | | | | | 1 | 28 |
- | 10 | BUFFER SORT | | 918K| | 22T (1)|999:59:59 | | |
- | 11 | PARTITION RANGE ALL | | 918K| | 27 (0)| 00:00:01 | 1 | 28 |
- | 12 | BITMAP CONVERSION TO ROWIDS | | 918K| | 27 (0)| 00:00:01 | | |
- | 13 | BITMAP INDEX FAST FULL SCAN | SALES_PROMO_BIX | | | | | 1 | 28 |
- ---------------------------------------------------------------------------------------------------------------------
- Note
- -----
- - automatic DOP: Computed Degree of Parallelism is 1
-
-
- SQL> alter session set events '10053 trace name context forever,level 1';
- Session altered.
- SQL> explain plan for select sum(a.amount_sold) from sales a,sales b,sales c;
- Explained.
- 10053 解释了 为什么 DOP 选择
- kkeCostToTime: using io calibrate stats
- maxmbps=49(MB/s) maxpmbps=66(MB/s)
- block_size=8192 mb_io_count=4 mb_io_size=30247 (bytes)
- tot_io_size=0(MB) time=0(ms)
- AUTO DOP PLANS EVALUATION
- ***************************************
- Compilation completed with Dop: 1.
- Cost_io: 0.00 Cost_cpu: 380000.00
- Card: 1.00 Bytes: 305.00
- Cost: 0.02 Est_time: 0ms
- kkopqSetDopReason: Reason why we chose this DOP is: no expensive parallel operation.
- No parallel scan operations
- kkopqCombineDop: Dop:1 Hint:no
- Query: compute:yes forced:no computedDop:2 forceDop:0
- kkopqSetDopReason: Reason why we chose this DOP is: parallel threshold.
- Serial phase is inexpensive (0), stick to it.
- Costing completed. DOP chosen: 1.
- AutoDop: kkopqSetMaxDopInCursorEnv:In the Cursor Session Env, max DOP is set to 43
- Reason why we chose this DOP is: no expensive parallel operation.
- Reason why we chose this DOP is: parallel threshold.
复制代码 CBO 认为 DOP =1 才是合理的 Serial phase is inexpensive (0), stick to it. Costing completed. DOP chosen: 1. |
|