mysql 索引未使用問題
現有表test,分別設置單號、條碼、時間、備注、金額等字段
限設置索引A:單號,B:條碼,C:時間
EXPLAIN
SELECT count(*)? FROM test WHERE 時間>='2018-11-14 00:00:00' AND 時間<'2018-11-15 00:00:00' group by 單號,條碼;
這句Sql未使用索引 key = null? ? ?key_len=null? ? ?type =ALL
如何優化成使用索引 !!!
不使用between and 的情況下!