Joint IndexThe definition of the joint index in this article is (MySQL): ALTER TABLE `table_name` ADD INDEX (`col1`,`col2`,`col3`); Advantages of joint indexesIf there is more than one SQL statement, two conditions are required. SELECT * FROM `user_info` WHERE username='XX',password='XXXXXX'; When the index is searching the The size of a matching index is smaller than that of a single index, and it is just an index tree, which saves more time and space complexity than a single column index. The essence of joint index hits (understanding of the leftmost match)definition When creating a ( DiagramPopular understanding A joint index is like a phone book organized by -- Only hit col1, col2 SELECT * FROM `table_name` WHERE `col1`='XX'; -- hit col1, col2. The order of col1 and col2 can be reversed SELECT * FROM `table_name` WHERE `clo1`='XX',`clo2`='XXX'; SELECT * FROM `table_name` WHERE `clo2`='XXX', `clo1`='XX'; -- hit col1,col2,col3. Similarly, the order of the three columns can be reversed. SELECT * FROM `table_name` WHERE `col1`='X',`col2`='XX',`col3`='XXX'; SELECT * FROM `table_name` WHERE `col1`='X',`col3`='XX',`col2`='XXX'; SELECT * FROM `table_name` WHERE `col2`='X',`col3`='XX',`col1`='XXX'; This is the end of this article about the implementation of MySQL joint index (compound index). For more relevant MySQL joint index content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: HTML tag ID can be a variable
>>: Operations of communication between Docker containers and external network communication
1. Introduction Recently, I helped a friend to ma...
Lists for organizing data After learning so many ...
This article example shares the specific code for...
Multi-way search tree Height of a complete binary...
nvm nvm is responsible for managing multiple vers...
JBoss uses Tomcat as the Web container, so the co...
This article example shares the specific code of ...
To set the line spacing of <p></p>, us...
Website, (100-1)% of the content is navigation 1....
This article shares the specific code for impleme...
I would like to ask a question. In Dreamweaver, I...
Chapter 1: Introduction to keepalived The purpose...
We usually use float layout to solve the compatib...
Install Jenkins via Yum 1. Installation # yum sou...
ffmpeg is a very powerful audio and video process...