当前位置:网站首页>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的更新是针对索引加的行级锁,非索引会升级为表锁。
边栏推荐
- 03 storage system
- Weibo and Huya advance into interest communities: different paths for peers
- TechSmith Camtasia studio 2022.0.2 screen recording software
- 找数字
- 进制形式
- Usage of database functions "recommended collection"
- Halcon knowledge: NCC_ Model template matching
- 一篇文章搞懂Go语言中的Context
- LeetCode 1200 最小绝对差[排序] HERODING的LeetCode之路
- How to build a technical team that will bring down the company?
猜你喜欢
Ffprobe common commands
函数计算异步任务能力介绍 - 任务触发去重
关于FPGA底层资源的细节问题
Huawei cloud database DDS products are deeply enabled
Weibo and Huya advance into interest communities: different paths for peers
Preliminary exploration of flask: WSGI
Kubernets Pod 存在 Finalizers 一直处于 Terminating 状态
Is BigDecimal safe to calculate the amount? Look at these five pits~~
产品好不好,谁说了算?Sonar提出分析的性能指标,帮助您轻松判断产品性能及表现
智能客服赛道:网易七鱼、微洱科技打法迥异
随机推荐
宽度与对齐
LeetCode 1200 最小絕對差[排序] HERODING的LeetCode之路
selenium 浏览器(2)
Kubernets pod exists finalizers are always in terminating state
Huawei cloud database DDS products are deeply enabled
這幾年爆火的智能物聯網(AIoT),到底前景如何?
文本挖掘工具的介绍[通俗易懂]
MySQL组合索引(多列索引)使用与优化案例详解
Korean AI team plagiarizes shock academia! One tutor with 51 students, or plagiarism recidivist
%S format character
They are all talking about Devops. Do you really understand it?
Openresty current limiting
Numpy notes
When synchronized encounters this thing, there is a big hole, pay attention!
leecode学习笔记-约瑟夫问题
[local differential privacy and random response code implementation] differential privacy code implementation series (13)
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
How to handle exceptions in multithreading?
selenium 元素交互
Unity脚本API—Transform 变换