優(yōu)化前:
select count(t.id) from test t where t.status = 1 and t.id not in (select distinct a.app_id from test2 a where a.type = 1 and a.rule_id in (152, 153, 154)) 17:20:57 laojiu>@planPLAN_TABLE_OUTPUT――――――――――――――――――――――――――――――――――――――――-Plan hash value: 684502086―――――――――――――――――――――――――――――-| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |―――――――――――――――――――――――――――――-| 0 | SELECT STATEMENT | | 1 | 18 | 176K (2)| 00:35:23 || 1 | SORT AGGREGATE | | 1 | 18 | | ||* 2 | FILTER | | | | | ||* 3 | TABLE ACCESS FULL| test | 1141 | 20538 | 845 (2)| 00:00:11 ||* 4 | TABLE ACCESS FULL| test2 | 1 | 12 | 309 (2)| 00:00:04 |―――――――――――――――――――――――――――――-Predicate Information (identified by operation id):――――――――――――――――― 2 主站蜘蛛池模板: 长宁县| 千阳县| 甘泉县| 四会市| 当雄县| 宁阳县| 德惠市| 苍溪县| 北辰区| 积石山| 包头市| 沁阳市| 耒阳市| 镇原县| 佳木斯市| 武隆县| 类乌齐县| 那曲县| 东阳市| 五寨县| 白银市| 罗定市| 格尔木市| 阿荣旗| 长子县| 剑川县| 子洲县| 赤水市| 丹巴县| 盘山县| 东阳市| 小金县| 新巴尔虎右旗| 鄂伦春自治旗| 正镶白旗| 西安市| 克什克腾旗| 凌源市| 财经| 蕲春县| 阳春市|