建了个索引select pk_corp_in from scss_transbill 时能使用到这个索引但是下面这句查询却不走索引select sum (coalesce (b.nnum, 0)) from scss_transbill a left outer join scss_transbill_b b on a.pk_transbill = b.pk_transbill where a.pk_corp_in = '1001' and ...
显示全部建了个索引
select pk_corp_in from scss_transbill 时能使用到这个索引
但是下面这句查询却不走索引
select sum (coalesce (b.nnum, 0)) from scss_transbill a left outer join scss_transbill_b b on a.pk_transbill = b.pk_transbill where a.pk_corp_in = '1001' and a.cincalbodyid = '1001A110000000000335' and b.cinwarehouseid = '1001A110000000000O22' and b.cinventoryid = '0001A110000000022CYG' and b.pk_pattern = '0001A110000000022JJZ' and b.dplanarrvdate >= '2011-08-16' and b.dplanarrvdate <= '2011-09-15' and a.vbillstatus <> 1 and coalesce (b.dr, 0) = 0 with ur
这是为神马!!!!!!求高手解释
收起