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;
如对本文有疑问, 点击进行留言回复!!
数据库优化-索引的创建-MySQL-index-SQL优化-避免全表扫描
网友评论