oracle利用绝杀招将hashjoin计划转变为nestloop

         以前遇到两个表做关联,每个表都是1亿以上的数据量,执行计划走的hashjoin,直接5个小时没执行完,我看看sql已经优化到没法优化了,但是加hint走nestloop后几分钟就执行完毕了,感觉对于数据量巨大的两个表,加条件的小表作为驱动表nestloop还是很快的

将hashjoin  转为 nested loop

hashjoin原文:
SELECT  KC24.AKB020 AS KC24_AKB020  ,
        KB01.AKB021 AS KB01_AKB021  ,
        KC24.AKC190 AS KC24_AKC190  ,
        KC24.AAE072 AS KC24_AAE072  ,
        KC24.BKA135 AS KC24_BKA135  ,
        KC24.AAE001 AS KC24_AAE001  ,
        KC24.AAC001 AS KC24_AAC001  ,
        KC24.AKA130 AS KC24_AKA130  ,
        KC24.AKC021 AS KC24_AKC021  ,
        KC24.BKC021 AS KC24_BKC021  ,
        KC24.AAB001 AS KC24_AAB001  ,
        KC24.AKE010 AS KC24_AKE010  ,
        KC24.BAA084 AS KC24_BAA084  ,
        KC24.BKC197 AS KC24_BKC197  ,
        KC24.BKE001 AS KC24_BKE001  ,
        KC24.AKC264 AS KC24_AKC264  ,
        KC24.BKC198 AS KC24_BKC198  ,
        KC24.BKC199 AS KC24_BKC199  ,
 

你可能感兴趣的:(oracle利用绝杀招将hashjoin计划转变为nestloop)