当前位置:网站首页>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的更新是针对索引加的行级锁,非索引会升级为表锁。
边栏推荐
- How to handle exceptions in multithreading?
- 开源人张亮的 17 年成长路线,热爱才能坚持
- [differential privacy and data adaptability] differential privacy code implementation series (XIV)
- 文本挖掘工具的介绍[通俗易懂]
- 音视频技术开发周刊 | 252
- Guitar Pro 8win10最新版吉他学习 / 打谱 / 创作
- Redis的4种缓存模式分享
- Redis 發布和訂閱
- Redis sentinel mode realizes one master, two slave and three Sentinels
- EventBridge 在 SaaS 企业集成领域的探索与实践
猜你喜欢

03 storage system

C1 certification learning notes 3 -- Web Foundation

Luo Gu - some interesting questions

leecode学习笔记-约瑟夫问题

The performance of major mainstream programming languages is PK, and the results are unexpected

深度学习 网络正则化

這幾年爆火的智能物聯網(AIoT),到底前景如何?

How to build a technical team that will bring down the company?

flutter 报错 No MediaQuery widget ancestor found.

go-zero微服务实战系列(九、极致优化秒杀性能)
随机推荐
Weekly recruitment | senior DBA annual salary 49+, the more opportunities, the closer success!
【大连理工大学】考研初试复试资料分享
Numpy notes
进制乱炖
Guitar Pro 8win10 latest guitar learning / score / creation
Redis 解决事务冲突之乐观锁和悲观锁
谈SaaS下如何迅速部署应用软件
十六进制
openresty 限流
[local differential privacy and random response code implementation] differential privacy code implementation series (13)
PLC Analog input analog conversion FC s_ ITR (CoDeSys platform)
SAIC Maxus officially released its new brand "mifa", and its flagship product mifa 9 was officially unveiled!
Leecode learning notes - Joseph problem
[differential privacy and data adaptability] differential privacy code implementation series (XIV)
LeetCode 1200 最小绝对差[排序] HERODING的LeetCode之路
Live broadcast preview | PostgreSQL kernel Interpretation Series II: PostgreSQL architecture
Width and alignment
I plan to teach myself some programming and want to work as a part-time programmer. I want to ask which programmer has a simple part-time platform list and doesn't investigate the degree of the receiv
31年前的Beyond演唱会,是如何超清修复的?
MP3是如何诞生的?