您好,登录后才能下订单哦!
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进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。