What is the principle of mysql index establishment?
Xiaobian to share with you what is the principle of mysql index establishment, I hope you have gained something after reading this article, let's discuss it together!
1. Try to select columns with high discrimination to establish indexes.
Frequent query columns are suitable for indexing.
When you encounter a joint index, think about the leftmost matching principle.
4, like fuzzy query, % in front of the index will be used, the other two cases will make the index invalid.
examples
select * from USER us where name l like ' % public number programmer fly%' //name has an index, then it will use the index on the name select * from USER us where name l like '% public number programmer fly' //name has an index, then the index will be invalid to full table scan select * from USER us where name l like '% public number programmer fly%' //name has an index, then the index will be invalid to full table scan Read this article I believe you have a certain understanding of "what is the principle of mysql index establishment". If you want to know more relevant knowledge, welcome to pay attention to the industry information channel. Thank you for reading!