参考
https://jaxenter.com/6-ways-optimize-sql-database-136448.html
提出了6个优化方案:
proper indexing
建立合适的索引
Retrieve the relevant data only
仅检索相关数据
Getting rid of correlated subqueries
摆脱相关的子查询
Using or avoid temporary tables according to requires
使用或避免使用 临时表,根据需求而定
avoid coding loops
避免编写循环的代码
Execution plans
执行计划,以展示sql代码的执行效率, 定位效率低的sql代码
sql优化: 优化途径一:优化mysql server
sql优化: 优化途径二:优化sql操作语句
sql优化: 优化途径三: 优化表的创建
执行计划: Explain