In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
What is varchar in mysql? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.
Varchar is a variable-length type in mysql. In a data column of type varchar, each value takes up just enough bytes, plus a byte used to record its length. If the maximum length of a string column is much larger than the average length, you can use varchar to store it.
Varchar Typ
Varchar is a variable-length type: in a data column of type varchar (M), each value occupies just enough bytes, plus a byte used to record its length (that is, the total length is 1 bytes).
When querying, mysql uses a fixed width for the varchar field in memory rather than the variable width when it is stored, especially the invisible temporary table created during the query. Therefore, when selecting field properties, it is enough to choose the most appropriate and minimum length according to your own business, so as to improve the query speed and reduce the overhead of the database server.
When to select the varchar column for storage?
1. The maximum length of a string column is much larger than the average length, giving full play to the characteristics of getting longer.
2. String columns that are rarely updated
Because a storage page of the innodb engine is 16k, frequent updates of variable length fields may lead to the splitting of the storage page, resulting in storage fragmentation.
3. Multi-byte character set, such as utf-8
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.