数据库
首页 > 数据库> > mysql-调优

mysql-调优

作者:互联网

mysql调优

1.选择合适的存储引擎

2.SQL语句调优(尽量避免全表扫描)

eg: select id from t1 where number is null 
优化:在number字段设置默认值0
eg: select id from t1 where id=10 or id=20;
优化:select id from t1 where id=10
      union all
      select id from t1 where id=20;
eg: select id from t1 where id in(1,2,3)
优化:select id from t1 where id between 1 and 3;

标签:尽量避免,t1,全表,调优,mysql,where,id,select
来源: https://www.cnblogs.com/miloli/p/12458985.html