- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
6#
发表于 2011-12-26 20:02:39
PX Deq: reap credit
PX Deq Credit: send blkd
IPC send completion sync
latch free ==> query server freelists by kxfpobrmf =>parallel query statistics
这4个 主要等待事件都指向 系统存在频繁的并行查询
而占用主要DB TIME的SQL是:
SQL ordered by Elapsed Time
Resources reported for PL/SQL code includes the resources used by all SQL statements called by the code.
% Total DB Time is the Elapsed Time of the SQL statement divided into the Total Database Time multiplied by 100
Elapsed Time (s) CPU Time (s) Executions Elap per Exec (s) % Total DB Time SQL Id SQL Module SQL Text
14,451 419 68 212.52 16.05 7x39qgz590xqz select tp.CONTEXTID as ...
13,073 389 68 192.25 14.52 gs0mw9thtjk48 select detail.orderid a...
9,904 310 68 145.65 11.00 1j4a0w8r2rkdx select tc.CONTEXTID as ...
看了下 7x39qgz590xqz gs0mw9thtjk48
1j4a0w8r2rkdx
三个sql均没有parallel hint ,按照lz的说话这些对象的degree也都是1 ,所以排除因为 hint和degree属性引发的并行查询
action plan:
1. 通过ASH 确认是到底哪些SQL语句引起了PX Deq类型的等待。,是否是7x39qgz590xqz gs0mw9thtjk48
1j4a0w8r2rkdx这些
2. 若能重现该现象,那么使用<脚本:监控并行进程状态> http://www.oracledatabase12g.com ... rallel-queries.html 监控并行查询 获得更多信息
3. metalink note Why Did My Query Go Parallel? [ID 196938.1] 介绍了普通查询并行化的几种可能引用如下:
Applies to:
Oracle Server - Enterprise Edition - Version: 8.1.7.4 and later [Release: 8.1.7 and later ]
Oracle Server - Personal Edition - Version: 8.1.7.4 and later [Release: 8.1.7 and later]
Information in this document applies to any platform.
Purpose
This article outlines things that will force the use of parallel query.
Scope and Application
DBA's & Support Analysts
Why Did My Query Go Parallel?
The following are features that will make the optimizer consider the use of a parallel plan for a query:
Parallel hints i.e. /*+ PARALLEL(emp,5) */ ?
Parallel session setting e.g.:
PARAMETER:parallel_automatic_tuning
PARAMETER:parallel_adaptive_multi_user
Setting a degree of parallel and/or the number of instances on a table or index in a query
The affect of setting a degree of parallelism on an index has changed. Prior to 8i this would have had no affect. Post 8i a parallel plan will be investigated. If degree is set ( to an integer value > 1 or to 'DEFAULT' ) on an object then this will mean a parallel plan is considered. Remember that the optimizer works on a cost basis so just because a parallel plan may be considered, does not mean that it will be chosen. Since 8i we have changed the syntax for the setting of degree of parallelism See Note 260845.1 Old and new Syntax for setting Degree of Parallelism .
Examples
The following examples use EMP which has no parallel degree or instances set. Choice of a parallel plan can be seen from the autotrace output (set autot trace explain).
SQL> select degree, instances from user_tables where table_name= 'EMP';
DEGREE INSTANCES
---------- ----------
1 1
Unhinted Query:
SQL> select * from emp;
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=14 Bytes=448)
1 0 TABLE ACCESS (FULL) OF 'EMP' (Cost=1 Card=14 Bytes=448)
Parallel Degree hint or setting degree on the table:
SQL> select /*+ parallel(emp,5) */ * from emp;
OR
SQL> alter table emp parallel(degree 5);
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=14 Bytes=448)
1 0 TABLE ACCESS* (FULL) OF 'EMP' (Cost=1 Card=14 Bytes=448) :Q492000
1 PARALLEL_TO_SERIAL SELECT /*+ NO_EXPAND ROWID(A1) */ A1."EMPNO"
,A1."ENAME",A1."JOB",A1."MGR",A1."HI
Parallel Instances hint or instances set in the object:
SQL> select /*+ parallel(emp,1,5) */ * from emp;
OR
SQL> alter table emp parallel(degree 1 instances 5);
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=14 Bytes=448)
1 0 TABLE ACCESS* (FULL) OF 'EMP' (Cost=1 Card=14 Bytes=448) :Q494000
1 PARALLEL_TO_SERIAL SELECT /*+ NO_EXPAND ROWID(A1) */ A1."EMPNO"
,A1."ENAME",A1."JOB",A1."MGR",A1."HI
NOTE that setting degree or instances will override any RULE hints:
SQL> select /*+ rule */ * from emp;
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=HINT: RULE (Cost=1 Card=14 Bytes=448)
1 0 TABLE ACCESS* (FULL) OF 'EMP' (Cost=1 Card=14 Bytes=448) :Q500000
1 PARALLEL_TO_SERIAL SELECT /*+ NO_EXPAND ROWID(A1) */ A1."EMPNO"
,A1."ENAME",A1."JOB",A1."MGR",A1."HI
[ 本帖最后由 maclean 于 2011-12-26 20:05 编辑 ] |
|