Home > database >  Oracle consulting complex SQL query optimization problem
Oracle consulting complex SQL query optimization problem

Time:05-20

By querying the Oracle view access to the following SQL query time about above 4 s, could you tell me whether there is space and the method of optimization,
Related tables are clustered index and index of associated field

 SELECT * FROM ROBXDJ ROBXDJ 
The JOIN LSZGZD LSZGZD ON ROBXDJ. ROBXDJ_YGNM=LSZGZD. LSZGZD_ID
The JOIN LSBZDW LSBZDW ON LSZGZD. LSZGZD_DWBH=LSBZDW. LSBZDW_DWBH
LEFT OUTER JOIN CODEITEMS CODEITEMS ON LSBZDW. COUNTRYORAREA=CODEITEMS. NM AND CODEITEMS. SETID='A019'
The LEFT OUTER JOIN HROrgDuty HROrgDuty ON LSZGZD. HRZGZD_XRZW=HROrgDuty. NM
The LEFT OUTER JOIN HRORGRANK HRORGRANK ON LSZGZD. LSZGZD_ZGZJ=HRORGRANK. NM
The JOIN LSBZDW LSBZDW1
ON ROBXDJ. ROBXDJ_DWBH=LSBZDW1. LSBZDW_DWBH
AND ((LSBZDW1 LSBZDW_GSLB & lt;> '3') AND (LSBZDW1 LSBZDW_GXDW & lt;> '1' OR LSBZDW1. LSBZDW_GXDW IS NULL OR LSBZDW1. LSBZDW_GXDW IS NULL) AND (LSBZDW1. LSBZDW_GSXZ & lt;> '3'))
The LEFT OUTER JOIN CODEITEMS CODEITEMS1
ON LSBZDW1. COUNTRYORAREA=CODEITEMS1. NM
AND CODEITEMS1. SETID='A019'
The JOIN ROBXLX ROBXLX ON ROBXDJ. ROBXDJ_BXLX=ROBXLX. ROBXLX_NM
The JOIN LSBMZD LSBMZD
ON ROBXDJ. ROBXDJ_DWBH=LSBMZD. LSBMZD_DWBH AND ROBXDJ. ROBXDJ_BMBH=LSBMZD. LSBMZD_BMBH
The LEFT OUTER JOIN LSBMSX LSBMSX ON LSBMZD. LSBMZD_SX=LSBMSX. LSBMSX_SXBH
The LEFT OUTER JOIN GSPUser GSPUser ON LSBMZD. LSBMZD_BMFZR=GSPUser. ID
The JOIN LSWBZD LSWBZD ON ROBXDJ. ROBXDJ_BXHB=LSWBZD. LSWBZD_BZBH
The LEFT OUTER JOIN ZWJSFS ZWJSFS ON ROBXDJ. ROBXDJ_YQFS=ZWJSFS. ZWJSFS_BH
The LEFT OUTER JOIN ROFYXM ROFYXM ON ROBXDJ. ROBXDJ_FYXM=ROFYXM. ROFYXM_NM
The LEFT OUTER JOIN ROZFFS ZFFS ON ROBXDJ. ROBXDJ_FKFS=ZFFS. ROZFFS_NM
The LEFT OUTER JOIN ZWJSFS ZWJSFS1 ON ZFFS. ROZFFS_JSFS=ZWJSFS1. ZWJSFS_BH
The JOIN ROYWZT ROYWZT ON ROBXDJ. ROBXDJ_ZT=ROYWZT. ROYWZT_ZT AND ROYWZT_YWLX='BX'
The LEFT OUTER JOIN GSPUser GSPUSER1 ON ROBXDJ. ROBXDJ_USERID=GSPUSER1. ID
The LEFT OUTER JOIN PROCESSINSTANCE PROCESSINSTANCE
ON ROBXDJ. ROBXDJ_LCSL=PROCESSINSTANCE. PROCESSINSTANCEID
The LEFT OUTER JOIN LSBZDW LSBZDW2
ON ROBXDJ. ROBXDJ_JZZZ=LSBZDW2. LSBZDW_DWBH
The LEFT OUTER JOIN ROHBYG ROHBYG
ON ROBXDJ. ROBXDJ_HBYGNM=ROHBYG. ROHBYG_NM
The LEFT OUTER JOIN ROHBGX ROHBGX ON ROHBYG. ROHBYG_GXNM=ROHBGX. ROHBGX_NM
The LEFT OUTER JOIN LSZGZD LSZGZD1
ON ROHBYG. ROHBYG_YGNM=LSZGZD1. LSZGZD_ID
The LEFT OUTER JOIN FSYWLX FSYWLX ON ROBXDJ. ROBXDJ_YWLX=FSYWLX. FSYWLX_NM
The LEFT OUTER JOIN GSPSECLEVEL GSPSECLEVEL
ON ROBXDJ. ROBXDJ_MJ=GSPSECLEVEL. ID
The LEFT OUTER JOIN LSBMZD LSBMZD1
ON ROBXDJ. ROBXDJ_JZBMID=LSBMZD1. LSBMZD_ID
The LEFT OUTER JOIN LSBMSX LSBMSX1
ON LSBMZD1. LSBMZD_SX=LSBMSX1. LSBMSX_SXBH
The LEFT OUTER JOIN GSPUser GSPUSER2 ON LSBMZD1. LSBMZD_BMFZR=GSPUSER2. ID
The LEFT OUTER JOIN ROBXDD ROBXDD
ON ROBXDJ. ROBXDJ_BXDDID=ROBXDD. ROBXDD_NM
The LEFT OUTER JOIN VW_BZZXGCXM VW_BZZXGCXM
ON ROBXDJ. ROBXDJ_GXM1=VW_BZZXGCXM. ZJGCXM_NM
The LEFT OUTER JOIN VW_BZZXHTB VW_BZZXHTB
ON ROBXDJ. ROBXDJ_GXM2=VW_BZZXHTB. ZJXMHTB_NM
The LEFT OUTER JOIN CODEITEMS CODEITEMS2
ON ROBXDJ. ROBXDJ_GXM4=CODEITEMS2. CODE
AND CODEITEMS2. SETID='M005'
The LEFT OUTER JOIN PMMDCYBK PMMDCYBK
ON ROBXDJ. ROBXDJ_GNM5=PMMDCYBK. CYBKID
The LEFT OUTER JOIN ROFYXM ROFYXM1
ON ROBXDJ. ROBXDJ_XM1=ROFYXM1. ROFYXM_NM
The LEFT OUTER JOIN PMMDGCZT PMMDGCZT
ON ROBXDJ. ROBXDJ_XM2=PMMDGCZT. GCZTID
The LEFT OUTER JOIN LSZGZD LSZGZD2
ON ROBXDJ. ROBXDJ_XM5=LSZGZD2. LSZGZD_ID
The LEFT OUTER JOIN ROFYXM ROFYXM2
ON ROBXDJ. ROBXDJ_XM7=ROFYXM2. ROFYXM_NM
The LEFT OUTER JOIN LSZGZD LSZGZD3
ON ROBXDJ. ROBXDJ_XM8=LSZGZD3. LSZGZD_ID
The LEFT OUTER JOIN CODEITEMS CODEITEMS3
ON ROBXDJ. ROBXDJ_XM9=CODEITEMS3. CODE
AND CODEITEMS3. SETID='M003'
The LEFT OUTER JOIN GSPUser GSPUSER3 ON ROBXDJ. ROBXDJ_XM10=GSPUSER3. ID
The LEFT OUTER JOIN LSBMZD LSBMZD2
ON ROBXDJ. ROBXDJ_XM11=LSBMZD2. LSBMZD_ID
The LEFT OUTER JOIN CODEITEMS CODEITEMS4
ON ROBXDJ. ROBXDJ_XM13=CODEITEMS4. CODE
AND CODEITEMS4. SETID='M017'
The LEFT OUTER JOIN LSHSXM2021 LSHSXM
ON ROBXDJ. ROBXDJ_XM14=LSHSXM. LSHSXM_ID
The LEFT OUTER JOIN ROFYXM ROFYXM3
ON ROBXDJ. ROBXDJ_XM15=ROFYXM3. ROFYXM_NM
The LEFT OUTER JOIN ROFYXM ROFYXM4
ON ROBXDJ. ROBXDJ_NM2=ROFYXM4. ROFYXM_NM
The LEFT OUTER JOIN LSBMZD LSBMZD3
ON ROBXDJ. ROBXDJ_NM3=LSBMZD3. LSBMZD_ID
The LEFT OUTER JOIN VW_EINVOICE_BZD DO_BZZX_DZDZK
ON ROBXDJ. ROBXDJ_NM20=DO_BZZX_DZDZK. ID
The LEFT OUTER JOIN ROFYXM ROFYXM5
ON ROBXDJ. ROBXDJ_NM4=ROFYXM5. ROFYXM_NM
WHERE ROBXDJ. ROBXDJ_NM='5 c4970a9 f78-6-480 - d - 88 b6-7 eba7d8e5baf'


The above SQL involves the size of the table shown in the screenshot below


Part of execution plan is as follows:
The Predicate Information (identified by operation id) :
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50 - access (" ROBXDJ ". "ROBXDJ_NM"='5 c4970a9 f78-6-480 - d - 88 b6-7 eba7d8e5baf')
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related