SELECT C.ID,
C.CATYPE,
C.ZZBH,
C.HZ,
C.BFRQ,
C.JZRQ,
C.SAVETYPE,
C.DOCID,
C.FBDOCID,
(CASE C.SAVETYPE
WHEN '2' THEN
'已签发'
ELSE
'未签发'
END) STYPE,
C.CREATOR USERID,
B.BSNUM,
B.SXZXNAME,
B.PERMID AS SXID,
B.APPNAME APPNAME,
B.APPCOMPANY APPCOMPANY,
B.PROJECTNAME,
B.XZXK,
B.DEPTID,
B.BJTYPE,
B.ENDFORTIME,
B.DATAID DATAID,
B.FLOWID,
E.GROUPID,
E.GROUPNAME,
E.NETWORKID,
E.YWGSD,
B.STATUS,
C.TYPE
,C.CID
FROM(SELECT CI.*,DECODE(CI.CREATEDATE,NULL,'0',F.TYPE) TYPE FROM T_SHARE_CERTIFICATEINSTANCE CI LEFT JOIN T_SYS_CERTIFICATECONFIG F ON CI.CID=F.ID )C(数据量大) ,
T_INS_BUSINESSINFO B,
T_INS_BUSINESS_EXT E
WHERE B.BSNUM = C.YWID(+)
AND B.BSNUM = E.BSNUM
AND B.SFCZ = '1'
AND DECODE(B.STATUS,'2',DECODE(C.TYPE,'0','1','0'),B.STATUS)='1'
AND( B.PERMID in
(SELECT M.SXID
FROM T_FLOW_PERM M, T_FLOW_GROUP_NODE N, T_FLOW_GROUP_HANDLER H
WHERE M.GID = H.GID
AND M.GID = N.GID
AND N.NODEID = H.NODEID
AND H.NODEID = 'ZZQF'
AND H.HANDLER IN ('20170223144725077357', '220015988')
) or b.deptid='220015988') AND nvl(C.SAVETYPE,'1')='1'
因为C表 数据量太大 导致查询慢 请问怎么优化啊
湖上湖
芜湖不芜
相关分类