如何優化下面的查詢時間(超過1小時)?我只能訪問表視圖,無法檢查查詢計劃和視圖索引。我只能改變查詢符號。表'c'已經獲得了超過32億的記錄。Oracle查詢時間優化
SELECT
a.APPLICATIONNUMBER,c.NEWSTATUSSYMBOL,c.MODDATE,c.NEXT_MODDATE
FROM a
LEFT JOIN
(SELECT
c000.ID,c000.NEWSTATUSSYMBOL,c000.MODDATE,c000.NEXT_MODDATE
FROM
(SELECT
c00.ID,c00.NEWSTATUSSYMBOL,c00.MODDATE,LEAD(c00.MODDATE,1) OVER (ORDER BY c00.ID, c00.MODDATE) AS NEXT_MODDATE
FROM
(SELECT
c0.ID,c0.STATUSSYMBOL,c0.NEWSTATUSSYMBOL,c0.MODDATE
FROM c0
WHERE (c0.STATUSSYMBOL in ('State1','State2','State3') OR c0.NEWSTATUSSYMBOL in ('State1','State2','State3'))
AND c0.TYPEID = 1
AND c0.HDB_START >= '15/01/01'
AND c0.HDB_LAST = 'Y')c00
)c000
WHERE
c000.NEWSTATUSSYMBOL in ('State1','State2','State3')) c
ON a.ID = c.ID
WHERE
a.APPLICATIONNUMBER like 'P%'
AND a.APPLICATIONSTATUSSYMBOL in ('State4','State5','State6')
AND a.APPLICATIONDATE >= to_timestamp('2015-01-01 00:00:01')
AND a.MODIFIEDDATE >= to_timestamp('2016-07-04 00:00:01')
AND a.MODIFIEDDATE <= to_timestamp('2016-07-10 23:59:59')
AND a.HDB_LAST = 'Y';
請張貼與predicats –
計劃查詢我在DB沒有獲得檢查查詢計劃:( – user3183215
我想索引的a.ID,c.ID,c0.HDB_START。 – user3183215