注册

sql查询非常慢

huishun 2023/08/30 1041 11

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:DM8
【操作系统】:
【CPU】:
【问题描述】*:

同样的sql和数据量,在oracle 只要3秒,达梦需要25秒,请帮忙看看

explain select
*
from
( select
this_.ID as ID278_1_,
this_.ACC_NAME1 as ACC2_278_1_,
this_.ACC_NAME2 as ACC3_278_1_,
this_.ACC_NO1 as ACC4_278_1_,
this_.ACC_NO2 as ACC5_278_1_,
this_.AMT as AMT278_1_,
this_.AUTH_OPT_NAME as AUTH7_278_1_,
this_.AUTH_OPT_NO as AUTH8_278_1_,
this_.CARD_NO1 as CARD9_278_1_,
this_.CARD_NO2 as CARD10_278_1_,
this_.CCY as CCY278_1_,
this_.CHECK_NO as CHECK12_278_1_,
this_.CLT_SEQNO as CLT13_278_1_,
this_.CORE_SEQ as CORE14_278_1_,
this_.CSH_TSF_FLAG as CSH15_278_1_,
this_.CURR_MONTH as CURR16_278_1_,
this_.CUSTOM_REQ as CUSTOM17_278_1_,
this_.DR_CR_FLAG as DR18_278_1_,
this_.EXTRA_RULE as EXTRA19_278_1_,
this_.FIRST_ORGID as FIRST20_278_1_,
this_.FIRST_ORGNAME as FIRST21_278_1_,
this_.FIRST_ORGNUM as FIRST22_278_1_,
this_.FIRST_ORGTYPE as FIRST23_278_1_,
this_.FIRST_ORGTYPENAME as FIRST24_278_1_,
this_.HAND_DATE as HAND25_278_1_,
this_.IMG_ID as IMG53_278_1_,
this_.IS_COP as IS26_278_1_,
this_.IS_REMOTE_AUTHORITY as IS27_278_1_,
this_.MONITOR_RULE as MONITOR28_278_1_,
this_.RELATION_STATUS as RELATION29_278_1_,
this_.REMARKS as REMARKS278_1_,
this_.REMARKS1 as REMARKS31_278_1_,
this_.REVERSAL_FLAG as REVERSAL32_278_1_,
this_.SCAN_BATCHNUM as SCAN33_278_1_,
this_.SECOND_ORGID as SECOND34_278_1_,
this_.SECOND_ORGNAME as SECOND35_278_1_,
this_.SECOND_ORGNUM as SECOND36_278_1_,
this_.SUPERVISE_DATE as SUPERVISE37_278_1_,
this_.SUPERVISE_STATUS as SUPERVISE38_278_1_,
this_.SUPERVISOR_CODE as SUPERVISOR39_278_1_,
this_.SUPERVISOR_NAME as SUPERVISOR40_278_1_,
this_.THIRD_ORGID as THIRD41_278_1_,
this_.THIRD_ORGNAME as THIRD42_278_1_,
this_.THIRD_ORGNUM as THIRD43_278_1_,
this_.TRADE_BREED_NAME as TRADE44_278_1_,
this_.TRADE_SUB_NAME as TRADE45_278_1_,
this_.TRAN_DATE as TRAN46_278_1_,
this_.TRAN_INST as TRAN47_278_1_,
this_.TRAN_OPT_NAME as TRAN48_278_1_,
this_.TRAN_OPT_NO as TRAN49_278_1_,
this_.TRAN_STAT as TRAN50_278_1_,
this_.TRAN_TYPE as TRAN51_278_1_,
this_.TRAN_TIME as TRAN52_278_1_,
imginfodto2_.ID as ID259_0_,
imginfodto2_.ACCOUNT as ACCOUNT259_0_,
imginfodto2_.ACCOUNT1 as ACCOUNT3_259_0_,
imginfodto2_.ACCOUNT1_NAME as ACCOUNT4_259_0_,
imginfodto2_.ACCOUNT_NAME as ACCOUNT5_259_0_,
imginfodto2_.AMT as AMT259_0_,
imginfodto2_.AMT1 as AMT7_259_0_,
imginfodto2_.AMT_D as AMT8_259_0_,
imginfodto2_.BATCH_NO as BATCH9_259_0_,
imginfodto2_.CETIF_DATE as CETIF10_259_0_,
imginfodto2_.CETIF_NO as CETIF11_259_0_,
imginfodto2_.CETIF_TYPE_ID as CETIF12_259_0_,
imginfodto2_.CETIF_TYPE_NAME as CETIF13_259_0_,
imginfodto2_.CLI_SERIAL_NO as CLI14_259_0_,
imginfodto2_.COMPOSITE as COMPOSITE259_0_,
imginfodto2_.CURR_MONTH as CURR16_259_0_,
imginfodto2_.EXTRA_RULE as EXTRA17_259_0_,
imginfodto2_.FH_ORG as FH18_259_0_,
imginfodto2_.FLOW_TRAN_NOTE as FLOW19_259_0_,
imginfodto2_.FLOW_WATER_ID as FLOW20_259_0_,
imginfodto2_.HAS_PROBLEMS as HAS21_259_0_,
imginfodto2_.IMAGE_CHANNEL as IMAGE22_259_0_,
imginfodto2_.IMAGESTATION_NID as IMAGEST23_259_0_,
imginfodto2_.IMAGESTATION_PID as IMAGEST24_259_0_,
imginfodto2_.IMG_N as IMG25_259_0_,
imginfodto2_.IMG_P as IMG26_259_0_,
imginfodto2_.INNER_ID as INNER27_259_0_,
imginfodto2_.IS_NEED_IMPORTANT as IS28_259_0_,
imginfodto2_.IS_SCANTYPE_ADD as IS29_259_0_,
imginfodto2_.MAKEUP_DATE as MAKEUP30_259_0_,
imginfodto2_.MAKEUP_USER as MAKEUP31_259_0_,
imginfodto2_.MONITOR_RULE as MONITOR32_259_0_,
imginfodto2_.OPERATOR_NO as OPERATOR33_259_0_,
imginfodto2_.ORG_NO as ORG34_259_0_,
imginfodto2_.OUTO_CHECK as OUTO35_259_0_,
imginfodto2_.PS_LEVEL as PS36_259_0_,
imginfodto2_.SCAN_ADD_REMARK as SCAN37_259_0_,
imginfodto2_.SIGN as SIGN259_0_,
imginfodto2_.SLAVE_COUNT as SLAVE39_259_0_,
imginfodto2_.SP_FLAG as SP40_259_0_,
imginfodto2_.SUPERVISE_DATE as SUPERVISE41_259_0_,
imginfodto2_.SUPERVISE_STATUS as SUPERVISE42_259_0_,
imginfodto2_.SUPERVISES as SUPERVISES259_0_,
imginfodto2_.SUPERVISOR_CODE as SUPERVISOR44_259_0_,
imginfodto2_.SUPERVISOR_NAME as SUPERVISOR45_259_0_,
imginfodto2_.TRADE_DATE as TRADE46_259_0_,
imginfodto2_.Z_INNERID as Z47_259_0_
from
ocrpopr.T_FLOW_WATER this_,
ocrpopr.T_IMG_INFO imginfodto2_
where
this_.IMG_ID=imginfodto2_.ID(+)
and this_.TRAN_INST=756045
and this_.IS_COP=1
and this_.TRAN_DATE>=20200818
and (
this_.SCAN_BATCHNUM is not null
)
order by
this_.ID desc )
where
rownum <= 15;

##time
DLCK 3 0% 16 0 2 0 0
PRJT2 6 0% 14 3 4 0 0
PRJT2 6 0% 14 2 4 0 0
NSET2 214 0% 13 1 3 0 0
PLL 446 0% 12 11 1992 0 0
BLKUP2 538 0% 11 12 1992 0 0
SSEK2 741 0% 10 13 996 0 0
ACTRL 10449 0.01% 9 7 36453 0 0
SORT3 11397 0.01% 8 4 1636 0 0
PLL 13654 0.01% 7 8 36464 0 0
IJLO2 16429 0.01% 6 6 38303 0 0
PLL 58976 0.05% 5 14 164210 0 0
SLCT2 1539699 1.36% 4 9 83399 0 0
HLO2 2814029 2.49% 3 5 102814 1 191088
CSCN2 53328500 47.25% 2 15 82111 0 0
CSCN2 55074728 48.79% 1 10 65161 0 0

##explain
1 #NSET2: [15997, 195, 2365]
2 #PRJT2: [15997, 195, 2365]; exp_num(100), is_atom(FALSE)
3 #PRJT2: [15997, 195, 2365]; exp_num(100), is_atom(FALSE)
4 #SORT3: [15997, 195, 2365]; key_num(1), is_distinct(FALSE), top_flag(1), is_adaptive(0)
5 #HASH LEFT JOIN2: [15982, 19591, 2365]; key_num(1), partition_keys_num(0), ret_null(0), mix(0) KEY(exp_cast(THIS_.IMG_ID)=IMGINFODTO2_.ID)
6 #INDEX JOIN LEFT JOIN2: [15982, 19591, 2365] ret_null(0)
7 #ACTRL: [15982, 19591, 2365];
8 #PARALLEL: [14878, 19591, 2365]; scan_type(FULL), key_num(0, 0, 0), simple(0)
9 #SLCT2: [14878, 19591, 2365]; (NOT(THIS_.SCAN_BATCHNUM IS NULL) AND exp_cast(THIS_.TRAN_INST) = 756045 AND exp_cast(THIS_.IS_COP) = 1 AND exp_cast(THIS_.TRAN_DATE) >= 20200818)
10 #CSCN2: [14878, 19542548, 2365]; INDEX33560845(T_FLOW_WATER as THIS_)
11 #PARALLEL: [220, 1, 30]; scan_type(FULL), key_num(0, 0, 0), simple(0)
12 #BLKUP2: [220, 1, 30]; INDEX33561349(IMGINFODTO2_)
13 #SSEK2: [220, 1, 30]; scan_type(ASC), INDEX33561349(T_IMG_INFO as IMGINFODTO2_), scan_range[exp_cast(THIS_.IMG_ID),exp_cast(THIS_.IMG_ID)]
14 #PARALLEL: [15978, 24627876, 2041]; scan_type(FULL), key_num(0, 0, 0), simple(0)
15 #CSCN2: [15978, 24627876, 2041]; INDEX33560822(T_IMG_INFO as IMGINFODTO2_)

回答 0
暂无回答
扫一扫
联系客服