当前位置:网站首页>0730~Mysql optimization
0730~Mysql optimization
2022-07-31 08:32:00 【Life is so hard】
Common reasons for index failure?
1. Use select*
2. There is no guarantee of the leftmost prefix principle
3. Do not add % to the left side of fuzzy query like -- solution covering index query
4.or improper use of keywords -- solution Use union to solve
5. There can be no calculation in the query condition
6. Functions cannot be used in query conditions
7.order by grouping order and set index are inconsistent, it will also fail
8.varchar type without single quotes
9. Use is null or is not null -- if the set property cannot be empty, then the index will not be taken,
If the set property can be empty, then is null will go to the index, is not null will not go to the index;
When executing the plan with EXPLAIN, mainly check the following fields
type: The type of query, at least ref, All is the worst case;
key: see which indexes are actually hit;
rows: look at the number of query queries;
Extra: Mainly see UsingWhere means filter with where condition;
边栏推荐
猜你喜欢
SSM framework explanation (the most detailed article in history)
C语言三子棋(井字棋)小游戏
【小程序项目开发 -- 京东商城】uni-app 商品分类页面(下)
MySql数据库优化查询工具
Cloud server deployment web project
SSM框架简单介绍
MySQL installation to the last step in the write the configuration file failed?And after the installation steps
[Cloud native and 5G] Microservices support 5G core network
一、MySQL主从复制原理
How to upgrade nodejs version
随机推荐
MySQL中InnoDB的多版本并发控制(MVCC)的实现
正则表达式绕过
SQL语句知识大全
[What is the role of auto_increment in MySQL?】
Ceph single node deployment
google搜索技巧——程序员推荐
【idea 报错】 无效的目标发行版:17 的解决参考
tqdm库的使用
《如何戒掉坏习惯》读书笔记
The torch distributed training
[Mini Program Project Development--Jingdong Mall] Custom Search Component of uni-app (Part 1)--Component UI
7/28-7/29 期望+思维+后缀数组+ST表
@Transactional注解的失效场景
A, MySQL principle of master-slave replication
【MySQL中auto_increment有什么作用?】
NK-RTU980烧写裸机程序
How to upgrade nodejs version
"The C language games" mine clearance
PowerCLi 通过自建PXE Server一键esxi7下批量部署常规New-VM
[PSQL] Complex query