查询挺慢的,看看有什么优化空间:
select (
SELECT
'裝卸說明:'||BC.LOADING_DESC||' CY電話'||BC.TEL
FROM TM_BOOKING_CONTAINER TBC,TM_BOOKING TB,BK_CONTAINER BC
WHERE EXISTS (SELECT 1 FROM ST_FEEDER_CTN_LINK FL WHERE FL.ST_FEEDER_ID=SF.ST_FEEDER_ID AND TBC.BK_CONTAINER_ID=FL.BK_CONTAINER_ID)
AND TBC.TM_BOOKING_ID=TB.TM_BOOKING_ID
AND TBC.BK_CONTAINER_ID=BC.BK_CONTAINER_ID
AND TB.BUSIENSS_TYPE='VCY'
AND ROWNUM=1
)AS LOADING_DESC_CY_TEL,
SF.OTHER_REMARK,
SF.OCEAN_VESSEL_CODE||'/'||SF.OCEAN_VOYAGE AS OCEAN_VVL,
SF.OCEAN_POL_NAME
FROM ST_FEEDER SF
LEFT JOIN ST_FEEDER_GLOBAL SFG ON SFG.ST_FEEDER_ID=SF.ST_FEEDER_ID AND SFG.GLOBAL_TYPE='TW'
WHERE SF.ST_FEEDER_ID IN (SELECT COLUMN_VALUE FROM TABLE(F_STR2TYTABLE('0000000068fbc36d016903bd0bd20169', ',')))
select count(*) from TM_BOOKING_CONTAINER;--654935
select count(*) from TM_BOOKING;--652019
select count(*) from BK_CONTAINER;--8043211
偶然的你
长风秋雁
相关分类