当前位置:网站首页>MYSQL索引优化
MYSQL索引优化
2022-07-04 14:15:00 【聪聪那些年】
目录
主键优化
页分裂
乱序插入id=50时,page=1会对半分裂,移动一半到page=3中,再将id=50插入。
页合并
主键设计
Order by
Limit 覆盖索引+子查询
SELECT * FROM xxx WHERE ID > =(select id from xxx limit 1000000, 1) limit 20;
SELECT * FROM xxx a JOIN (select id from xxx limit 1000000, 20) b ON a.ID = b.id;
Count
count(1)和count(*)的性能最好
Update
update的更新是针对索引加的行级锁,非索引会升级为表锁。
边栏推荐
- 2022 financial products that can be invested
- Helix swarm Chinese package is released, and perforce further improves the user experience in China
- flutter 报错 No MediaQuery widget ancestor found.
- 这几年爆火的智能物联网(AIoT),到底前景如何?
- 关于FPGA底层资源的细节问题
- How to handle exceptions in multithreading?
- Exploration and practice of eventbridge in the field of SaaS enterprise integration
- PLC Analog input analog conversion FC s_ ITR (CoDeSys platform)
- unity update 协程_Unity 协程的原理
- MP3是如何诞生的?
猜你喜欢
LNX efficient search engine, fastdeploy reasoning deployment toolbox, AI frontier paper | showmeai information daily # 07.04
Helix swarm Chinese package is released, and perforce further improves the user experience in China
Implementation of macro instruction of first-order RC low-pass filter in signal processing (easy touch screen)
对话龙智高级咨询顾问、Atlassian认证专家叶燕秀:Atlassian产品进入后Server时代,中国用户应当何去何从?
Halcon knowledge: NCC_ Model template matching
go-zero微服务实战系列(九、极致优化秒杀性能)
Preliminary exploration of flask: WSGI
Flutter reports an error no mediaquery widget ancestor found
Numpy notes
Memory management summary
随机推荐
开源人张亮的 17 年成长路线,热爱才能坚持
Helix swarm Chinese package is released, and perforce further improves the user experience in China
[local differential privacy and random response code implementation] differential privacy code implementation series (13)
TechSmith Camtasia studio 2022.0.2 screen recording software
MP3是如何诞生的?
How to build a technical team that will bring down the company?
Width and alignment
宽度精度
[learning notes] matroid
js平铺数据查找叶子节点
%f格式符
這幾年爆火的智能物聯網(AIoT),到底前景如何?
Redis哨兵模式实现一主二从三哨兵
Unity脚本API—Transform 变换
Deep learning network regularization
小数,指数
unity update 协程_Unity 协程的原理
文本挖掘工具的介绍[通俗易懂]
Redis sentinel mode realizes one master, two slave and three Sentinels
Leecode learning notes - Joseph problem