1. Joint index descriptionCreate a joint index of three fields The joint index (a,b,c) is equivalent to creating the index: (a), (a,b), (a,b,c) 2. Can ac use indexes?
1. Create an abc joint index (province, city, district) ac index query SELECT * FROM user_address WHERE province = 'Guangdong' AND district = 'Nanxiong City'
2. Create a joint index for the two fields ac directly SELECT * FROM user_address WHERE province = 'Guangdong' AND district = 'Nanxiong City'
3.ab index query
in conclusion abc joint index, c in ac cannot hit the joint index of these three fields, but a can hit it, so the possible_keys column will show that the joint index is used. 3. Thinkingabc index, will acb follow the index?
4. The cause of the leftmost matching principle
This is the end of this article about the leftmost matching principle of MySQL database index. For more relevant MySQL index leftmost matching content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of vuex persistence in practical application of vue
>>: A detailed introduction to Linux system operation levels
Use profile to analyze slow SQL The main purpose ...
Preface Note: The test database version is MySQL ...
Note: To crack the root password in MySQL5.7, you...
In the past few days, I have studied how to run s...
This article shares the specific code of JavaScri...
If you want to solve the slow problem once and fo...
Table of contents Preface Understanding a stack a...
You can view the container logs through the docke...
Table of contents Preface Ajax serial and paralle...
1. About the file server In a project, if you wan...
CSS has two pseudo-classes that are not commonly ...
Operation effect: html <div class="tic-ta...
introduce Setting up read-write separation for th...
1. A container is an independently running applic...
1. Create a database: create data data _name; Two...