当前位置:网站首页>MySQL -- index principle + how to use
MySQL -- index principle + how to use
2022-07-03 10:48:00 【Samooyou】
One 、 Introduce
Why an index ?
General application system , The proportion of reading and writing is 10:1 about , And insert operations and general update operations rarely have performance problems , In the production environment , We met the most , It's also the most problematic , Or some complex query operations , Therefore, the optimization of query statements is obviously the top priority . Speaking of accelerating query , I have to mention index .
What is index ?
Index in MySQL Also known as “ key ”, It is a data structure used by the storage engine to quickly find records . Indexing for good performance
It's critical , Especially when there is more and more data in the table , The impact of indexes on performance is increasingly important .
Index optimization should be the most effective way to optimize query performance . Indexes can easily improve query performance by several orders of magnitude .
Index the phonetic order of a dictionary , If you want to find a word , If you don't use a sound sequence table , It needs to be checked page by page from hundreds of pages .
Do you have any misunderstanding about index ?
Indexing is an important aspect of application design and development . If there are too many indexes , The performance of the application may be affected . There are too few indexes , It also has an impact on query performance , To find a balance , This is critical to the performance of the application . Some developers always think of adding indexes after the fact ---- I always thought , It comes from a wrong development model . If you know the use of data , You should add indexes where you need them from the beginning . Developers often use the database at the application level , For example, writing SQL sentence 、 Stored procedures and so on , They may not even know the index exists , Or think it's relevant after the event DBA Add it on .DBA Often not enough to understand the data flow of the business , Adding indexes requires monitoring a large number of SQL The sentence then finds the problem , The time required for this step must be much longer than the time required for the initial index addition , And may miss a part of the index . Of course, there are not many indexes
边栏推荐
- extern关键字
- Leaders always entrust the work to flattering employees
- Common scenarios in which Seata distributed transactions fail and do not take effect (transactions do not rollback)
- Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported
- C语言项目:学生成绩系统
- Ind yff first week
- CSDN, I'm coming!
- Classification (data consolidation and grouping aggregation)
- Leetcode刷题---374
- Pytoch has been installed, but vs code still displays no module named 'torch‘
猜你喜欢
Numpy realizes the classification of iris by perceptron
Pour vous amener dans le monde des bases de données natives du cloud
MySQL checks for automatic updates at 0:00 every day
Softmax 回归(PyTorch)
深度学习入门之自动求导(Pytorch)
Introduction to deep learning linear algebra (pytorch)
The story of a 30-year-old tester struggling, even lying flat is extravagant
Entropy method to calculate weight
Redis 笔记 01:入门篇
Hou Jie -- STL source code analysis notes
随机推荐
深度学习入门之线性回归(PyTorch)
Leetcode刷题---977
Leetcode skimming ---202
Entropy method to calculate weight
Nuget add reference error while installing packages
How to hide cvxpy warnings: warn: a- > P (column pointers) not strictly increasing, column x empty?
Ind FHL first week
Bidding website architecture project progress -- Network Security
缓存路由组件
The story of a 30-year-old tester struggling, even lying flat is extravagant
如何监测服务器主机的进出流量?
QT:QSS自定义 QTabWidget 和 QTabBar实例
Matrix calculation of Neural Network Introduction (pytoch)
Leetcode刷题---35
Leetcode刷题---367
2021-09-22
安装yolov3(Anaconda)
Unity小组工程实践项目《最强外卖员》策划案&纠错文档
Unity group engineering practice project "the strongest takeaway" planning case & error correction document
Numpy quick start (I) -- pre knowledge (create array + constant + data type)