mysql调优 选择合适的存储引擎 经常用来读的表使用myisam引擎 其余的表都使用innodb引擎 sql语句调优(尽量避免全表扫描) 在select where order by常涉及到的字段上建立
mysql调优
选择合适的存储引擎
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;
--结束END--
本文标题: mysql-调优
本文链接: https://www.lsjlt.com/news/4863.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-16
2024-03-15
2024-03-15
2024-03-15
2024-03-15
2024-03-15
2024-03-15
2024-03-15
2024-03-15
2024-03-14
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0