MYSQL - SQL优化
发布时间:2024年01月06日
插入数据优化
小批量数据
批量插入
最好插入500-1000条比较好
手动提交事务
主键顺序插入

大批量插入数据

主键优化
页分裂


页合并


主键优化设计原则

order by优化


group by优化

limit优化


count优化


count(1)里面不一定必须1,数字都可以
update优化
更新字段时最好根据索引字段更新,根据索引字段更新是行锁,但是如果更新的字段没有索引,就会变成表锁,其他对这个表的更新就无法进行。
文章来源:https://blog.csdn.net/weixin_44273624/article/details/135405506
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:chenni525@qq.com进行投诉反馈,一经查实,立即删除!