In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article to share with you about mysql index is what kind of, Xiaobian think quite practical, so share to everyone to learn, I hope you can read this article after some harvest, not much to say, follow Xiaobian to see it.
What is the index in MySQL?
Index is also called "key" in mysql. It is a kind of mark used by mysql storage engine to quickly find records. Index plays a very important role in improving query speed. When the amount of data in the table is large enough, the role of index becomes more and more important.
Creating and maintaining indexes takes a lot of hard disk space and time, but it can greatly improve query speed.
Before using the index, you need to pay attention.
As much as possible to use some simple data types, ×× data type than string, processing overhead will be much less, because string comparison is more complex. In MySQL, time should be stored with built-in date and time data types, not strings; and IP addresses should be stored with integer data types.
Avoid nulls as much as possible Specify not null for every field (unless you want to store NULL) Columns with nulls are difficult to query optimize in MySQL because they complicate indexes, index statistics, and comparison operations. You should replace null with zero, a special value, or an empty string.
Don't overuse indexes.
The frequent condition behind where after query statement is more suitable for index.
It is not recommended to add indexes to fields with too concentrated values. Even if you add indexes, it will not improve the efficiency much (such as gender: male/female).
6. Select * from users where YEAR(adddate)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.