Adding indexes can improve query efficiency. Adding an index means adding an index file, which stores the address of the data, similar to the directory of our document. During the search process, you do not need to search from the contents of the book, but can directly search according to the page number corresponding to the directory. Indexes are searched based on addresses. Use explain to view the SQL execution planExecution plan type Indicates the way MySQL finds the required row in the table, also known as the "access type". Common types are as follows: ALL, index, range, ref, eq_ref, const, system, NULL 1. Use or to query multiple columns, type=all2. Use fuzzy query, type=all3. Operations on indexed fields4. If the column type is a string, it needs to be quoted. The name field is a string typeWithout quotes type=all There are quotation marks tye=ref First of all, MySQL has a type conversion rule that converts "characters to numbers". The above SQL contains operations: 5. Reverse query distinction (not, not in, not like, <>, !=, !>, !<) Use index effects Other situations 1. The associated fields in the joint index do not use the same character set; This concludes this article on several situations in which adding an index to MySQL does not work. For more information about adding an index to MySQL not working, please search for previous articles on 123WORDPRESS.COM or continue browsing the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of Vue life cycle functions
>>: Better looking CSS custom styles (title h1 h2 h3)
Use JOIN instead of sub-queries MySQL supports SQ...
There are two types of hard disks in Linux: mount...
Why should we read the log? For example, if the c...
Notice! ! ! select * from user where uid not in (...
Preface The latest version of MySQL 8.0 is 8.0.4 ...
1. Permanent modification, valid for all users # ...
Table of contents Overview What is lazy loading? ...
Cell -- the content of the table Cell margin (tabl...
Many web pages have small triangles in their navi...
Table of contents Mainly used Postman functions D...
1. What is ElasticSearch? Elasticsearch is also d...
Linux uses iftop to monitor the traffic of the ne...
Overview MySQL also has its own event scheduler, ...
VMware vSphere is the industry's leading and ...
This article describes the MySQL integrity constr...