麻烦经验丰富的大神给解答下,谢谢
问题描述:数据量不大,按理说应该毫秒返回,where条件查询两个条件很快(where sellerMemberId=? and status=? --1秒之内 执行计划看图1),(where sellerMemberId=? and status=? and mergeOrderStatus=? --10秒之上 执行计划看图2),这又是为什么???
表数据量:30w
表操作:求count
命中数据量:570
索引情况:where条件字段都有索引
执行sql语句:SELECT COUNT(0) AS total FROM al_order_1 t1
WHERE sellerMemberId = 'b2b-2413499052' AND status = '买家已付款' AND mergeOrderStatus IN ('0', '3', '4') AND gmtcreate <= '2017-12-09 23:59' AND gmtcreate >= '2017-11-24 00:00'
图1:查询2个where条件的执行计划
图2:查询多个where条件的执行计划执行计划: