您好,登錄后才能下訂單哦!
SELECT COUNT(1) AS count
FROM (
SELECT a.ykf272, a.akb020, a.akb021, a.yka094, a.ake005
, a.yke936, a.ykf282, a.aac003, a.aac001, a.aac002
, a.akc225, a.akc226, a.ykf275, a.ykf281, a.ykf284
, a.ykf283, a.yke453, a.aae011, a.aae036, a.yke923
, a.yke925, a.yab003, b.yka059, b.yka002, b.yke627
, b.yka095, a.yke938, a.yke940, x.ake006
, pkg_common.fun_getAaa103('YKF062', x.ykf062) AS ykf062
, (
SELECT c.aaa103
FROM bm_ykf063 c
WHERE b.ykf063 = c.ykf063
) AS ykf063, b.yka007, x.ykf064
, (
SELECT pkg_common.fun_getAaa103('AKA070', c.aka070)
FROM ka02 c
WHERE b.yka002 = c.yka002
) AS aka070, pkg_common.fun_getAaa103('YKE469', b.yke469) AS yke469, b.aka074
FROM kz37k1 a, ka05 b, (
SELECT akb020, ake005, yka094, ake006, ykf062
, ykf064
FROM (
SELECT x.akb020, x.ake005, x.yka094, x.ake006, x.ykf064
, x.ykf062, DENSE_RANK() OVER (PARTITION BY x.akb020, x.ake005, x.yka094 ORDER BY aae030 DESC) AS r
FROM kb05k1 x
)
WHERE r = 1
) x
WHERE a.yka094 = b.yka094
AND a.akb020 = x.akb020
AND a.ake005 = x.ake005
AND a.yka094 = x.yka094
AND a.akb020 = '855855'
AND a.yab003 = '0001'
AND trunc(a.aae036, 'dd') >= '08-APR-18'
AND trunc(a.aae036, 'dd') <= '10-APR-18')a;
現在我們發現了問題的原因,那么怎么能阻止謂詞推入呢?我們去找找outline部分里面對應該行為的hint。
謂詞推入是cbo一種優化的行為,但是謂詞推入并不總是好的,如果謂詞被推入后縮小了結果集,降低了邏輯讀,那就是好的,反之就不太好,其實cbo并不是只要有謂詞推入的機會就會推入,由于統計信息不準確,傾斜的列上沒有直方圖,都會導致cbo在計算cost
的時候產生較大偏差,而對于大的業務表,數據變化頻繁,也不能總收集統計信息,所以這時候我們就需要去找到合適的hint來協助cbo做出最優的選擇。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。