当前位置:网站首页>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
边栏推荐
猜你喜欢

Ind wks first week

Install yolov3 (Anaconda)

Numpy quick start (II) -- Introduction to array (creation of array + basic operation of array)

8、 Transaction control language of MySQL

Automatic derivation of introduction to deep learning (pytoch)

Ut2015 learning notes

Class-Variant Margin Normalized Softmax Loss for Deep Face Recognition

Knowledge map enhancement recommendation based on joint non sampling learning
![[untitled]](/img/41/adf5638e4a36417ce8dba3f2c4d9ed.jpg)
[untitled]

Ut2016 learning notes
随机推荐
[untitled]
If you always feel that you need to persist in learning English
Ind FXL first week
Leetcode刷题---44
Nuget add reference error while installing packages
Leetcode刷题---704
Ut2014 supplementary learning notes
FileNotFoundError: Could not find module ‘... dll‘ (or one of its dependencies).
Chiyou (), a specific mythical image, is also gradually abstracted as a dramatic character type "Jing". "Jing", born in Dan Dynasty and ugly at the end, is the earliest "profession" in Chinese drama
八、MySQL之事务控制语言
[combinatorial mathematics] pigeon nest principle (simple form examples of pigeon nest Principle 4 and 5)
Multi-Task Feature Learning for Knowledge Graph Enhanced Recommendation
Leetcode刷题---202
Windows security center open blank
丢弃法Dropout(Pytorch)
[roast & brain hole] Some Thoughts on the bullet screen interactive game of Wei Shu Wu Three Kingdoms when visiting station B
Ut2013 learning notes
Set ArrayList nested map set loop traversal
8、 Transaction control language of MySQL
Leetcode刷题---1