mysql SQL優化

1.應儘可能避免全表掃描,首先應考慮在 where 及 order by 涉及的列上創建索引 2.以下查詢不走索引 1)where 子句中使用!=或<>操做符 2)where 子句中對字段進行 null 值判斷 3) where 子句中使用 or 來鏈接條件 4)where like '%abc%'  ,能夠考慮全文檢索,like 'abc%'走索引 5)in 和 not in 也要慎用 ,能用
相關文章
相關標籤/搜索