- 最后登录
- 2012-12-24
- 在线时间
- 19 小时
- 威望
- 77
- 金钱
- 367
- 注册时间
- 2012-5-25
- 阅读权限
- 50
- 帖子
- 38
- 精华
- 0
- 积分
- 77
- UID
- 457
|
1#
发表于 2012-7-10 09:32:45
|
查看: 5371 |
回复: 3
select nvl(b.provname, '其他') "地区",
count(distinct serv_number) "系统来话用户数",
count(distinct case when callsucc_num >= 1 then serv_number else null end) "系统接通用户数",
count(distinct case when agentcall_num >= 1 then serv_number else null end) "人工来话用户数",
count(distinct case when agentsucc_num >= 1 then serv_number else null end) "人工接通用户数",
count(distinct case when agentsucc_num - abnormal_num - novoice_num >= 1 and deal_date >= date '2012-02-01' then serv_number else null end) "语音查询用户数"
from nxtdw.tb_dw_callin_userlist a,
nxtdw.tb_dic_zhongxing_pov b,
nxtdw.tb_dic_icd_prov c
where b.level_prov = '2'
and a.deal_date >= date '2012-05-01'
and a.deal_date <= date '2012-05-31'
and ((a.prov_code = b.provcode and b.level_prov = 1) or (a.area_code = b.provcode and b.level_prov = 2))
and 1 = 1
and 1 = 1
and b.prov_id = c.prov_id
group by b.provname
429 rows selected.
Elapsed: 00:00:14.75
Execution Plan
----------------------------------------------------------
Plan hash value: 1099810629
---------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
---------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 378 | 23058 | 5298 (3)| 00:01:04 | | |
| 1 | SORT GROUP BY | | 378 | 23058 | | | | |
| 2 | CONCATENATION | | | | | | | |
|* 3 | HASH JOIN | | 894K| 52M| 2649 (3)| 00:00:32 | | |
|* 4 | HASH JOIN | | 383 | 7277 | 7 (15)| 00:00:01 | | |
| 5 | TABLE ACCESS FULL | TB_DIC_ICD_PROV | 32 | 96 | 3 (0)| 00:00:01 | | |
|* 6 | TABLE ACCESS FULL | TB_DIC_ZHONGXING_POV | 383 | 6128 | 3 (0)| 00:00:01 | | |
| 7 | PARTITION LIST ITERATOR | | 1167K| 46M| 2630 (3)| 00:00:32 | KEY | KEY |
|* 8 | TABLE ACCESS FULL | TB_DW_CALLIN_USERLIST | 1167K| 46M| 2630 (3)| 00:00:32 | KEY | KEY |
|* 9 | HASH JOIN | | 1 | 61 | 2649 (3)| 00:00:32 | | |
|* 10 | HASH JOIN | | 1 | 58 | 2645 (3)| 00:00:32 | | |
|* 11 | TABLE ACCESS FULL | TB_DIC_ZHONGXING_POV | 1 | 16 | 3 (0)| 00:00:01 | | |
| 12 | PARTITION LIST ITERATOR| | 1167K| 46M| 2630 (3)| 00:00:32 | KEY | KEY |
|* 13 | TABLE ACCESS FULL | TB_DW_CALLIN_USERLIST | 1167K| 46M| 2630 (3)| 00:00:32 | KEY | KEY |
| 14 | TABLE ACCESS FULL | TB_DIC_ICD_PROV | 32 | 96 | 3 (0)| 00:00:01 | | |
---------------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - access("A"."AREA_CODE"="B"."PROVCODE")
4 - access("B"."PROV_ID"="C"."PROV_ID")
6 - filter("B"."LEVEL_PROV"=2 AND "B"."LEVEL_PROV"=2)
8 - filter("A"."DEAL_DATE">=TO_DATE(' 2012-05-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
"A"."DEAL_DATE"<=TO_DATE(' 2012-05-31 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
9 - access("B"."PROV_ID"="C"."PROV_ID")
10 - access("A"."PROV_CODE"="B"."PROVCODE")
filter(LNNVL("A"."AREA_CODE"="B"."PROVCODE") OR LNNVL("B"."LEVEL_PROV"=2))
11 - filter("B"."LEVEL_PROV"=1 AND "B"."LEVEL_PROV"=2)
13 - filter("A"."DEAL_DATE">=TO_DATE(' 2012-05-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
"A"."DEAL_DATE"<=TO_DATE(' 2012-05-31 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
Statistics
----------------------------------------------------------
88 recursive calls
14 db block gets
11472 consistent gets
11071 physical reads
0 redo size
16912 bytes sent via SQL*Net to client
800 bytes received via SQL*Net from client
30 SQL*Net roundtrips to/from client
0 sorts (memory)
1 sorts (disk)
429 rows processed
大家帮我看看有没有优化的建议么? |
|