存在一個加速下面的sql查詢的機會? select
max(xtrid) as xtrid
, jid
from jpltab jl
inner join rb_cust u
on jl.custid = u.custid
where jl.tpe = 'Y'
and jl.jid in (51, 52, 53, 54, 55)
an
我在嘗試優化查詢,但看到一個我不明白的奇怪行爲。 我有一張表包含近200萬條記錄,在列「status_code」上有一個索引,它是tinyint。 當我打電話與在第10號的查詢時,MySQL做一個全表掃描 select * from `table` as t
where t.code in (1,2,3,4,5,6,7,8,9,10);
當我把它與IN子句中9號,使用索引。 select *