当前位置:网站首页>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;
边栏推荐
- 0730~Mysql优化
- shell/bash脚本命令教程
- Vulkan与OpenGL对比——Vulkan的全新渲染架构
- [Yellow ah code] Introduction to MySQL - 3. I use select, the boss directly drives me to take the train home, and I still buy a station ticket
- [Mini Program Project Development--Jingdong Mall] Custom Search Component of uni-app (Middle)--Search Suggestions
- 【黄啊码】MySQL入门—3、我用select ,老板直接赶我坐火车回家去,买的还是站票
- Calculation example of matlab program iEEE9 node system for power flow calculation of AC-DC hybrid system based on alternate iteration method
- SSM框架讲解(史上最详细的文章)
- 蚂蚁核心科技产品亮相数字中国建设峰会 持续助力企业数字化转型
- torch分布式训练
猜你喜欢

安装部署KubeSphere管理kubernetes
![[Mini Program Project Development--Jingdong Mall] Custom Search Component of uni-app (Middle)--Search Suggestions](/img/ea/ee1ad50a497478b9d080bb5e4bdfb5.png)
[Mini Program Project Development--Jingdong Mall] Custom Search Component of uni-app (Middle)--Search Suggestions

Flutter Paystack 所有选项实现

Open Source | Commodity Recognition Recommender System

【云原生】微服务之Feign的介绍与使用

【面试题】从输入URL到游览器渲染完成,经历了什么

【小程序专栏】总结uniapp开发小程序的开发规范

SQL语句知识大全

Ubuntu22.04安装mysql

如何在一台机器上(windows)安装两个MYSQL数据库
随机推荐
Ubuntu22.04安装mysql
使用MySQL如何查询一年中每月的记录数
mysql安装教程【安装版】
MySQL 5.7 安装教程(全步骤、保姆级教程)
SSM整合案例分析(详解)
PowerCLi 一键批量部署OVA 到esxi 7
NK - RTU980 burning bare-metal program
如何在 Linux 上安装 MySQL
【C#】说说 C# 9 新特性的实际运用
How to upgrade nodejs version
The first part of the R language
SSM框架讲解(史上最详细的文章)
安装部署KubeSphere管理kubernetes
一文读懂Elephant Swap,为何为ePLATO带来如此高的溢价?
日志导致线程Block的这些坑,你不得不防
sqlmap使用教程大全命令大全(图文)
Locust 1.0版本引入的变化
求职产品经理【九】求职季,如何写好一份简历?
关于“算力”,这篇文章值得一看
[PSQL] Complex query