优化总结:
由于非索引列没有收集直方图导致oracle采用了错误的执行计划(nested loop),基于该列实际查询出来的值(568020)远大于原统计信息的值(1),通常当子查询出来的结果小于10000行时oracle才会使用nested loop。收集该列直方图后,执行计划走HASH JOIN,优化前执行了13个多小时都没执行成功,优化后10分钟不到执行完成。
dynamic sampling
used for this statement
以为是统计信息没收集导致的sql执行有问题
对sql进行统计信息收集后让应用执行,于7月3号下午6点多开始执行,4号上午10点应用电话说sql还没执行完。
查看sql执行计划:
Plan hash value: 1191577578
-------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-------------------------------------------------------------------------------------------------------------------
| 0 | INSERT STATEMENT | | | | 515K(100)| |
| 1 | LOAD TABLE CONVENTIONAL | | | | | |
| 2 | VIEW | | 8 | 296 | 515K (1)| 01:43:07 |
| 3 | UNION-ALL | | | | | |
| 4 | SORT AGGREGATE | | 1 | 50 | | |
|* 5 | HASH JOIN RIGHT SEMI | | 189 | 9450 | 5391 (1)| 00:01:05 |
|* 6 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 7 | TABLE ACCESS FULL | CDR0_01_MP00_02 | 528K| 10M| 4932 (1)| 00:01:00 |
| 8 | SORT AGGREGATE | | 1 | 156 | | |
|* 9 | TABLE ACCESS BY INDEX ROWID | CDR0_01_MP00_02 | 1 | 67 | 9 (0)| 00:00:01 |
| 10 | NESTED LOOPS | | 193 | 156 | 118K (1)| 00:23:45 |
| 11 | NESTED LOOPS | | 1 | 89 | 118K (1)| 00:23:45 |
|* 12 | TABLE ACCESS FULL | MCBBJ_01_SP_OPER | 1 | 60 | 118K (1)| 00:23:39 |
| 13 | SORT UNIQUE | | 9715 | 275K| 458 (1)| 00:00:06 |
|* 14 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 15 | INDEX RANGE SCAN | IDX_FILENAME_MCBBJ_02_SP_OPER | 193 | | 2 (0)| 00:00:01 |
| 16 | SORT AGGREGATE | | 1 | 50 | | |
|* 17 | HASH JOIN RIGHT SEMI | | 2336 | 114K| 2409 (1)| 00:00:29 |
|* 18 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 19 | TABLE ACCESS FULL | CDR0_01_MP00_03 | 221K| 4551K| 1951 (1)| 00:00:24 |
| 20 | SORT AGGREGATE | | 1 | 156 | | |
|* 21 | TABLE ACCESS BY INDEX ROWID | CDR0_01_MP00_03 | 1 | 67 | 83 (0)| 00:00:01 |
| 22 | NESTED LOOPS | | 2379 | 156 | 118K (1)| 00:23:46 |
| 23 | NESTED LOOPS | | 1 | 89 | 118K (1)| 00:23:45 |
|* 24 | TABLE ACCESS FULL | MCBBJ_01_SP_OPER | 1 | 60 | 118K (1)| 00:23:39 |
| 25 | SORT UNIQUE | | 9715 | 275K| 458 (1)| 00:00:06 |
|* 26 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 27 | INDEX RANGE SCAN | IDX_FILENAME_MCBBJ_03_SP_OPER | 2379 | | 9 (0)| 00:00:01 |
| 28 | SORT AGGREGATE | | 1 | 57 | | |
|* 29 | HASH JOIN RIGHT SEMI | | 2902 | 161K| 16056 (1)| 00:03:13 |
|* 30 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 31 | TABLE ACCESS FULL | CDR0_01_DED0_02 | 290K| 7934K| 15597 (1)| 00:03:08 |
| 32 | SORT AGGREGATE | | 1 | 13 | | |
| 33 | VIEW | VM_NWVW_1 | 1 | 13 | 119K (1)| 00:23:49 |
| 34 | SORT GROUP BY | | 1 | 174 | 119K (1)| 00:23:49 |
|* 35 | TABLE ACCESS BY INDEX ROWID| CDR0_01_DED0_02 | 1 | 75 | 366 (0)| 00:00:05 |
| 36 | NESTED LOOPS | | 2813 | 174 | 119K (1)| 00:23:49 |
| 37 | NESTED LOOPS | | 1 | 99 | 118K (1)| 00:23:45 |
|* 38 | TABLE ACCESS FULL | MCBBJ_01_SP_OPER | 1 | 70 | 118K (1)| 00:23:39 |
| 39 | SORT UNIQUE | | 9715 | 275K| 458 (1)| 00:00:06 |
|* 40 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 41 | INDEX RANGE SCAN | IDX_CDR0_01_DED0_02_SPCODE | 2813 | | 6 (0)| 00:00:01 |
| 42 | SORT AGGREGATE | | 1 | 57 | | |
|* 43 | HASH JOIN RIGHT SEMI | | 2902 | 161K| 16056 (1)| 00:03:13 |
|* 44 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 45 | TABLE ACCESS FULL | CDR0_01_DED0_02 | 290K| 7934K| 15597 (1)| 00:03:08 |
| 46 | SORT AGGREGATE | | 1 | 13 | | |
| 47 | VIEW | VM_NWVW_2 | 1 | 13 | 119K (1)| 00:23:49 |
| 48 | SORT GROUP BY | | 1 | 174 | 119K (1)| 00:23:49 |
|* 49 | TABLE ACCESS BY INDEX ROWID| CDR0_01_DED0_02 | 1 | 75 | 366 (0)| 00:00:05 |
| 50 | NESTED LOOPS | | 2813 | 174 | 119K (1)| 00:23:49 |
| 51 | NESTED LOOPS | | 1 | 99 | 118K (1)| 00:23:45 |
|* 52 | TABLE ACCESS FULL | MCBBJ_01_SP_OPER | 1 | 70 | 118K (1)| 00:23:39 |
| 53 | SORT UNIQUE | | 9715 | 275K| 458 (1)| 00:00:06 |
|* 54 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 55 | INDEX RANGE SCAN | IDX_CDR0_01_DED0_02_SPCODE | 2813 | | 6 (0)| 00:00:01 |
-------------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
5 - access("A"."FILE_NAME"=TRIM("FILE_NAME"))
6 - filter("SERV_TYPE"='8001')
7 - filter("A"."MSG_FEE"<>0)
9 - filter(("A"."MSG_FEE"<>0 AND "A"."SP_CODE"="B"."SP_CODE" AND "A"."OPER_CODE"="B"."OPERATOR_CODE"
AND "B"."BILL_FLAG"=SUBSTR("A"."BILLING_TYPE",2,1) AND "A"."MEMBER_TYPE"="B"."MEMBER_TYPE" AND
"B"."VALID_DATE"<=SUBSTR(TRIM("A"."START_DATETIME"),1,8) AND
"B"."EXPIRE_DATE">SUBSTR(TRIM("A"."START_DATETIME"),1,8)))
12 - filter("B"."SVC_CODE"='MP')
14 - filter("SERV_TYPE"='8001')
15 - access("A"."FILE_NAME"=TRIM("FILE_NAME"))
17 - access("A"."FILE_NAME"=TRIM("FILE_NAME"))
18 - filter("SERV_TYPE"='8001')
19 - filter("A"."MSG_FEE"<>0)
21 - filter(("A"."MSG_FEE"<>0 AND "A"."SP_CODE"="B"."SP_CODE" AND "A"."OPER_CODE"="B"."OPERATOR_CODE"
AND "B"."BILL_FLAG"=SUBSTR("A"."BILLING_TYPE",2,1) AND "A"."MEMBER_TYPE"="B"."MEMBER_TYPE" AND
"B"."VALID_DATE"<=SUBSTR(TRIM("A"."START_DATETIME"),1,8) AND
"B"."EXPIRE_DATE">SUBSTR(TRIM("A"."START_DATETIME"),1,8)))
24 - filter("B"."SVC_CODE"='MP')
26 - filter("SERV_TYPE"='8001')
27 - access("A"."FILE_NAME"=TRIM("FILE_NAME"))
29 - access(TRIM("A"."FILE_NAME")=TRIM("FILE_NAME"))
30 - filter("A"."SERV_TYPE"='7777')
31 - filter(("A"."SVC_TYPE"='MUSIC' AND "A"."MSG_FEE"<>0))
35 - filter(("T"."SVC_TYPE"='MUSIC' AND "T"."MSG_FEE"<>0 AND "T"."OPER_CODE"="P"."OPERATOR_CODE" AND
"P"."BILL_FLAG"=SUBSTR("T"."BILLING_TYPE",2,1) AND "P"."VALID_DATE"<=SUBSTR(TRIM("T"."USE_DATTIME"),1,8)
AND "P"."EXPIRE_DATE">SUBSTR(TRIM("T"."USE_DATTIME"),1,8) AND TRIM("T"."FILE_NAME")=TRIM("FILE_NAME")))
38 - filter(("P"."SVC_CODE"='MP' AND "P"."MEMBER_TYPE"='0'))
40 - filter("A"."SERV_TYPE"='7777')
41 - access("T"."SP_CODE"="P"."SP_CODE")
43 - access(TRIM("A"."FILE_NAME")='E'||TRIM("FILE_NAME"))
44 - filter("A"."SERV_TYPE"='7777')
45 - filter(("A"."SVC_TYPE"='MUSIC' AND "A"."MSG_FEE"<>0))
49 - filter(("T"."SVC_TYPE"='MUSIC' AND "T"."MSG_FEE"<>0 AND "T"."OPER_CODE"="P"."OPERATOR_CODE" AND
"P"."BILL_FLAG"=SUBSTR("T"."BILLING_TYPE",2,1) AND "P"."VALID_DATE"<=SUBSTR(TRIM("T"."USE_DATTIME"),1,8)
AND "P"."EXPIRE_DATE">SUBSTR(TRIM("T"."USE_DATTIME"),1,8) AND
TRIM("T"."FILE_NAME")='E'||TRIM("FILE_NAME")))
52 - filter(("P"."SVC_CODE"='MP' AND "P"."MEMBER_TYPE"='0'))
54 - filter("A"."SERV_TYPE"='7777')
55 - access("T"."SP_CODE"="P"."SP_CODE")
|
sql如下:
insert into CLEARAPP.huadan_stat(notes,month,monthORdetail,mod_num,withMcbbj,count_num)
select '音乐平台下载',month,monthORdetail,mod_num,mcbbj,fee from
(select '201506' month,'cdr0_01_mp00' monthORdetail,'02' mod_num,'NO' mcbbj,count(a.MSG_FEE) fee
from CLEARAPP.cdr0_01_mp00_02 a
where a.msg_fee!=0
and a.file_name in (select trim(file_name)
from CLEARAPP.bf_cdr01_201506 t
where SERV_TYPE = '8001')
UNION ALL
select '201506' month,'cdr0_01_mp00' monthORdetail,'02' mod_num,'YES' mcbbj,count(a.MSG_FEE) fee
from CLEARAPP.cdr0_01_mp00_02 a,CLEARAPP.mcbbj_01_sp_oper b
where a.sp_code = b.sp_code
and a.oper_code=b.operator_code
and substr(a.billing_type,2,1)=b.bill_flag
and a.member_type=b.member_type
and b.svc_code = 'MP'
and a.msg_fee!=0
and (b.valid_date<=substr(trim(a.start_datetime),1,8) and substr(trim(a.start_datetime),1,8)< b.expire_date)
and a.file_name in (select trim(file_name)
from CLEARAPP.bf_cdr01_201506 t
where SERV_TYPE = '8001')
UNION ALL
select '201506' month,'cdr0_01_mp00' monthORdetail,'03' mod_num,'NO' mcbbj,count(a.MSG_FEE) fee
from CLEARAPP.cdr0_01_mp00_03 a
where a.msg_fee!=0
and a.file_name in (select trim(file_name)
from CLEARAPP.bf_cdr01_201506 t
where SERV_TYPE = '8001')
UNION ALL
select '201506' month,'cdr0_01_mp00' monthORdetail,'03' mod_num,'YES' mcbbj,count(a.MSG_FEE) fee
from CLEARAPP.cdr0_01_mp00_03 a,CLEARAPP.mcbbj_01_sp_oper b
where a.sp_code = b.sp_code
and a.oper_code=b.operator_code
and substr(a.billing_type,2,1)=b.bill_flag
and a.member_type=b.member_type
and b.svc_code = 'MP'
and a.msg_fee!=0
and (b.valid_date<=substr(trim(a.start_datetime),1,8) and substr(trim(a.start_datetime),1,8)< b.expire_date)
and a.file_name in (select trim(file_name)
from CLEARAPP.bf_cdr01_201506 t
where SERV_TYPE = '8001')
UNION ALL
select '201506' month,'cdr0_01_ded0' monthORdetail,'02' mod_num,'NO' mcbbj,count(a.MSG_FEE) fee
from CLEARAPP.cdr0_01_ded0_02 a
where a.msg_fee!=0
and a.svc_type='MUSIC'
and trim(a.file_name) in
(select trim(file_name)
from CLEARAPP.bf_cdr01_201506 a where a.Serv_Type = '7777')
UNION ALL
select '201506' month,'cdr0_01_ded0' monthORdetail,'02' mod_num,'YES' mcbbj,count(t.MSG_FEE) fee
from CLEARAPP.cdr0_01_ded0_02 t,
(select p.serv_type,p.sp_code,p.operator_code,p.valid_date,p.expire_date,p.bill_flag,p.out_prop
from clearapp.mcbbj_01_sp_oper p where p.svc_code='MP'and p.member_type='0'
group by p.serv_type,p.sp_code,p.operator_code,p.valid_date,p.expire_date,p.bill_flag,p.out_prop) b
where t.sp_code = b.sp_code
and t.oper_code = b.operator_code
and substr(T.billing_type,2,1)=b.bill_flag
and t.msg_fee!=0
and t.svc_type='MUSIC'
and trim(t.file_name) in (select trim(file_name) from CLEARAPP.bf_cdr01_201506 a
where a.Serv_Type = '7777')
and (b.valid_date<=substr(trim(t.use_dattime),1,8) and substr(trim(t.use_dattime),1,8)< b.expire_date)
UNION ALL
select '201506' month,'cdr0_01_ded0_e' monthORdetail,'02' mod_num,'NO' mcbbj,count(a.MSG_FEE) fee
from CLEARAPP.cdr0_01_ded0_02 a
where a.msg_fee!=0
and a.svc_type='MUSIC'
and trim(a.file_name) in
(select 'E' || trim(file_name)
from CLEARAPP.bf_cdr01_201506 a where a.Serv_Type = '7777')
UNION ALL
select '201506' month,'cdr0_01_ded0_e' monthORdetail,'02' mod_num,'YES' mcbbj,count(t.MSG_FEE) fee
from CLEARAPP.cdr0_01_ded0_02 t,
(select p.serv_type,p.sp_code,p.operator_code,p.valid_date,p.expire_date,p.bill_flag,p.out_prop
from clearapp.mcbbj_01_sp_oper p where p.svc_code='MP' and p.member_type='0'
group by p.serv_type,p.sp_code,p.operator_code,p.valid_date,p.expire_date,p.bill_flag,p.out_prop) b
where t.sp_code = b.sp_code
and t.oper_code = b.operator_code
and substr(T.billing_type,2,1)=b.bill_flag
and t.msg_fee!=0
and t.svc_type='MUSIC'
and trim(t.file_name) in
(select 'E' || trim(file_name)
from CLEARAPP.bf_cdr01_201506 a where a.Serv_Type = '7777')
and(b.valid_date<=substr(trim(t.use_dattime),1,8) and substr(trim(t.use_dattime),1,8)< b.expire_date)
)
|
查看发现执行计划走NESTED LOOPS,MCBBJ_01_SP_OPER 基于 SVC_CODE='MP' 结果为1。如果为1的话执行肯定不需要这么长的时间,在数据库内执行如下查询:
SQL> select count(1) from CLEARAPP.mcbbj_01_sp_oper where svc_code = 'MP';
COUNT(1)
----------
568020
Execution Plan
----------------------------------------------------------
Plan hash value: 136857710
---------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 12 | 118K (1)| 00:23:39 |
| 1 | SORT AGGREGATE | | 1 | 12 | | |
|* 2 | TABLE ACCESS FULL| MCBBJ_01_SP_OPER | 1 | 12 | 118K (1)| 00:23:39 |
---------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - filter("SVC_CODE"='MP')
Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
538441 consistent gets
0 physical reads
0 redo size
528 bytes sent via SQL*Net to client
519 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
|
发现结果远大于1,走
NESTED LOOPS 的话可能就无法执行出结果,初步怀疑由于 svc_code 列没有收集直方图导致oracle走了错误的执行计划
查看表的统计信息如下:
重新执行收集统计信息
exec DBMS_STATS.GATHER_TABLE_STATS(ownname=>'CLEARAPP',tabname=>'MCBBJ_01_SP_OPER',method_opt=>'for all indexed columns size skewonly for columns SVC_CODE size skewonly',estimate_percent=>10,no_invalidate=>false,cascade=>true,degree => 10);
查看表统计信息
再次执行发现执行计划如下:
select count(1) from CLEARAPP.mcbbj_01_sp_oper where svc_code = 'MP';
Execution Plan
----------------------------------------------------------
Plan hash value: 136857710
---------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 4 | 119K (1)| 00:23:58 |
| 1 | SORT AGGREGATE | | 1 | 4 | | |
|* 2 | TABLE ACCESS FULL| MCBBJ_01_SP_OPER | 567K| 2216K| 119K (1)| 00:23:58 |
---------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - filter("SVC_CODE"='MP')
Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
538441 consistent gets
1261 physical reads
0 redo size
528 bytes sent via SQL*Net to client
519 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
|
手动执行 insert 语句的select部分,执行计划如下:
Execution Plan
----------------------------------------------------------
Plan hash value: 310038709
----------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 8 | 536 | 559K (1)| 01:51:50 |
| 1 | UNION-ALL | | | | | |
| 2 | SORT AGGREGATE | | 1 | 50 | | |
|* 3 | HASH JOIN RIGHT SEMI | | 189 | 9450 | 5391 (1)| 00:01:05 |
|* 4 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 5 | TABLE ACCESS FULL | CDR0_01_MP00_02 | 528K| 10M| 4932 (1)| 00:01:00 |
| 6 | SORT AGGREGATE | | 1 | 148 | | |
|* 7 | HASH JOIN | | 1 | 148 | 125K (1)| 00:25:03 |
|* 8 | HASH JOIN RIGHT SEMI | | 189 | 18144 | 5391 (1)| 00:01:05 |
|* 9 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 10 | TABLE ACCESS FULL | CDR0_01_MP00_02 | 528K| 33M| 4932 (1)| 00:01:00 |
|* 11 | TABLE ACCESS FULL | MCBBJ_01_SP_OPER | 567K| 28M| 119K (1)| 00:23:58 |
| 12 | SORT AGGREGATE | | 1 | 50 | | |
|* 13 | HASH JOIN RIGHT SEMI | | 2336 | 114K| 2409 (1)| 00:00:29 |
|* 14 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 15 | TABLE ACCESS FULL | CDR0_01_MP00_03 | 221K| 4551K| 1951 (1)| 00:00:24 |
| 16 | SORT AGGREGATE | | 1 | 148 | | |
|* 17 | HASH JOIN | | 3 | 444 | 122K (1)| 00:24:27 |
|* 18 | HASH JOIN RIGHT SEMI | | 2336 | 219K| 2409 (1)| 00:00:29 |
|* 19 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 20 | TABLE ACCESS FULL | CDR0_01_MP00_03 | 221K| 14M| 1951 (1)| 00:00:24 |
|* 21 | TABLE ACCESS FULL | MCBBJ_01_SP_OPER | 567K| 28M| 119K (1)| 00:23:58 |
| 22 | SORT AGGREGATE | | 1 | 57 | | |
|* 23 | HASH JOIN RIGHT SEMI | | 2904 | 161K| 16056 (1)| 00:03:13 |
|* 24 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 25 | TABLE ACCESS FULL | CDR0_01_DED0_02 | 290K| 7939K| 15597 (1)| 00:03:08 |
| 26 | SORT AGGREGATE | | 1 | 13 | | |
| 27 | VIEW | VM_NWVW_1 | 2 | 26 | 135K (1)| 00:27:11 |
| 28 | HASH GROUP BY | | 2 | 332 | 135K (1)| 00:27:11 |
|* 29 | HASH JOIN | | 2 | 332 | 135K (1)| 00:27:11 |
|* 30 | HASH JOIN RIGHT SEMI| | 2904 | 294K| 16056 (1)| 00:03:13 |
|* 31 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 32 | TABLE ACCESS FULL | CDR0_01_DED0_02 | 290K| 20M| 15597 (1)| 00:03:08 |
|* 33 | TABLE ACCESS FULL | MCBBJ_01_SP_OPER | 141K| 8589K| 119K (1)| 00:23:58 |
| 34 | SORT AGGREGATE | | 1 | 57 | | |
|* 35 | HASH JOIN RIGHT SEMI | | 2904 | 161K| 16056 (1)| 00:03:13 |
|* 36 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 37 | TABLE ACCESS FULL | CDR0_01_DED0_02 | 290K| 7939K| 15597 (1)| 00:03:08 |
| 38 | SORT AGGREGATE | | 1 | 13 | | |
| 39 | VIEW | VM_NWVW_2 | 2 | 26 | 135K (1)| 00:27:11 |
| 40 | HASH GROUP BY | | 2 | 332 | 135K (1)| 00:27:11 |
|* 41 | HASH JOIN | | 2 | 332 | 135K (1)| 00:27:11 |
|* 42 | HASH JOIN RIGHT SEMI| | 2904 | 294K| 16056 (1)| 00:03:13 |
|* 43 | TABLE ACCESS FULL | BF_CDR01_201506 | 9715 | 275K| 458 (1)| 00:00:06 |
|* 44 | TABLE ACCESS FULL | CDR0_01_DED0_02 | 290K| 20M| 15597 (1)| 00:03:08 |
|* 45 | TABLE ACCESS FULL | MCBBJ_01_SP_OPER | 141K| 8589K| 119K (1)| 00:23:58 |
----------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - access("A"."FILE_NAME"=TRIM("FILE_NAME"))
4 - filter("SERV_TYPE"='8001')
5 - filter("A"."MSG_FEE"<>0)
7 - access("A"."SP_CODE"="B"."SP_CODE" AND "A"."OPER_CODE"="B"."OPERATOR_CODE" AND
"B"."BILL_FLAG"=SUBSTR("A"."BILLING_TYPE",2,1) AND
"A"."MEMBER_TYPE"="B"."MEMBER_TYPE")
filter("B"."VALID_DATE"<=SUBSTR(TRIM("A"."START_DATETIME"),1,8) AND
"B"."EXPIRE_DATE">SUBSTR(TRIM("A"."START_DATETIME"),1,8))
8 - access("A"."FILE_NAME"=TRIM("FILE_NAME"))
9 - filter("SERV_TYPE"='8001')
10 - filter("A"."MSG_FEE"<>0)
11 - filter("B"."SVC_CODE"='MP')
13 - access("A"."FILE_NAME"=TRIM("FILE_NAME"))
14 - filter("SERV_TYPE"='8001')
15 - filter("A"."MSG_FEE"<>0)
17 - access("A"."SP_CODE"="B"."SP_CODE" AND "A"."OPER_CODE"="B"."OPERATOR_CODE" AND
"B"."BILL_FLAG"=SUBSTR("A"."BILLING_TYPE",2,1) AND
"A"."MEMBER_TYPE"="B"."MEMBER_TYPE")
filter("B"."VALID_DATE"<=SUBSTR(TRIM("A"."START_DATETIME"),1,8) AND
"B"."EXPIRE_DATE">SUBSTR(TRIM("A"."START_DATETIME"),1,8))
18 - access("A"."FILE_NAME"=TRIM("FILE_NAME"))
19 - filter("SERV_TYPE"='8001')
20 - filter("A"."MSG_FEE"<>0)
21 - filter("B"."SVC_CODE"='MP')
23 - access(TRIM("A"."FILE_NAME")=TRIM("FILE_NAME"))
24 - filter("A"."SERV_TYPE"='7777')
25 - filter("A"."SVC_TYPE"='MUSIC' AND "A"."MSG_FEE"<>0)
29 - access("T"."SP_CODE"="P"."SP_CODE" AND "T"."OPER_CODE"="P"."OPERATOR_CODE" AND
"P"."BILL_FLAG"=SUBSTR("T"."BILLING_TYPE",2,1))
filter("P"."VALID_DATE"<=SUBSTR(TRIM("T"."USE_DATTIME"),1,8) AND
"P"."EXPIRE_DATE">SUBSTR(TRIM("T"."USE_DATTIME"),1,8))
30 - access(TRIM("T"."FILE_NAME")=TRIM("FILE_NAME"))
31 - filter("A"."SERV_TYPE"='7777')
32 - filter("T"."SVC_TYPE"='MUSIC' AND "T"."MSG_FEE"<>0)
33 - filter("P"."SVC_CODE"='MP' AND "P"."MEMBER_TYPE"='0')
35 - access(TRIM("A"."FILE_NAME")='E'||TRIM("FILE_NAME"))
36 - filter("A"."SERV_TYPE"='7777')
37 - filter("A"."SVC_TYPE"='MUSIC' AND "A"."MSG_FEE"<>0)
41 - access("T"."SP_CODE"="P"."SP_CODE" AND "T"."OPER_CODE"="P"."OPERATOR_CODE" AND
"P"."BILL_FLAG"=SUBSTR("T"."BILLING_TYPE",2,1))
filter("P"."VALID_DATE"<=SUBSTR(TRIM("T"."USE_DATTIME"),1,8) AND
"P"."EXPIRE_DATE">SUBSTR(TRIM("T"."USE_DATTIME"),1,8))
42 - access(TRIM("T"."FILE_NAME")='E'||TRIM("FILE_NAME"))
43 - filter("A"."SERV_TYPE"='7777')
44 - filter("T"."SVC_TYPE"='MUSIC' AND "T"."MSG_FEE"<>0)
45 - filter("P"."SVC_CODE"='MP' AND "P"."MEMBER_TYPE"='0')
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
1979580 consistent gets
16427 physical reads
29580 redo size
1004 bytes sent via SQL*Net to client
519 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
8 rows processed
|
kill原来执行的sql语句,让应用重新执行
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29953799/viewspace-1723377/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29953799/viewspace-1723377/