当前位置:网站首页>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的更新是针对索引加的行级锁,非索引会升级为表锁。
边栏推荐
- C1 certification learning notes 3 -- Web Foundation
- 怎么判断外盘期货平台正规,资金安全?
- LNX efficient search engine, fastdeploy reasoning deployment toolbox, AI frontier paper | showmeai information daily # 07.04
- [local differential privacy and random response code implementation] differential privacy code implementation series (13)
- Preliminary exploration of flask: WSGI
- Is BigDecimal safe to calculate the amount? Look at these five pits~~
- Redis publish and subscribe
- 从0到1建设智能灰度数据体系:以vivo游戏中心为例
- 干货 | fMRI标准报告指南新鲜出炉啦,快来涨知识吧
- 近一亿美元失窃,Horizon跨链桥被攻击事件分析
猜你喜欢
Huawei cloud database DDS products are deeply enabled
Who the final say whether the product is good or not? Sonar puts forward performance indicators for analysis to help you easily judge product performance and performance
Dialogue with ye Yanxiu, senior consultant of Longzhi and atlassian certification expert: where should Chinese users go when atlassian products enter the post server era?
Leecode learning notes - Joseph problem
Unity动画Animation Day05
Leetcode 1200 minimum absolute difference [sort] The Path of leetcode for heroding
SAIC Maxus officially released its new brand "mifa", and its flagship product mifa 9 was officially unveiled!
MySQL组合索引(多列索引)使用与优化案例详解
Five minutes of machine learning every day: why do we need to normalize the characteristics of numerical types?
numpy笔记
随机推荐
Five minutes per day machine learning: use gradient descent to complete the fitting of multi feature linear regression model
Quelles sont les perspectives de l'Internet intelligent des objets (aiot) qui a explosé ces dernières années?
函数计算异步任务能力介绍 - 任务触发去重
基于MAX31865的温度控制系统
Analysis of nearly 100 million dollars stolen and horizon cross chain bridge attacked
UFO: Microsoft scholars have proposed a unified transformer for visual language representation learning to achieve SOTA performance on multiple multimodal tasks
PXE网络
信号处理之一阶RC低通滤波器宏指令实现(繁易触摸屏)
Details of FPGA underlying resources
mysql 联合主键_Mysql 创建联合主键[通俗易懂]
Five minutes of machine learning every day: how to use matrix to represent the sample data of multiple characteristic variables?
中国主要城市人均存款出炉,你达标了吗?
Guitar Pro 8win10 latest guitar learning / score / creation
从0到1建设智能灰度数据体系:以vivo游戏中心为例
Implementation of web chat room
夜天之书 #53 Apache 开源社群的“石头汤”
Preliminary exploration of flask: WSGI
Deep learning network regularization
How to handle exceptions in multithreading?
进制乱炖