Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the principle of mysql index establishment?

Shulou Source: shulou.com Published: 2022-06-02 22:19:47 10月02日 Update

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!

Tags: Indexes principles the public programs programmers articles queries frequent finished examples situations more knowledge industry information information channels channels differentiation federation selection Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Apple MySQL OPPO Reno Shulou Technology