1 SQL查询优化

SQL语句优化 对查询进行优化,要尽量避免全表扫描。在 where 或 order by 的列上加索引。 尽量避免在 where 子语句中有 where num is null,这样不用索引,要全表扫描,可用 0 代替 null 避免在 where 中用<>or!=,因为要全表扫描 尽量避免在 where 中用 or,因为若一个字段有索引,一个没有,则要全表扫描 like”%abc%”,全表扫描
相关文章
相关标签/搜索