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)06/01 Report--
This article mainly introduces Mysql column types and storage space, hoping to supplement and update some knowledge. If you have any other questions you need to know, you can continue to follow my updated article in industry information.
Mysql is stored as files on the hard disk of our system, so
(1) there is a problem with disk IO when we read and write.
(2) when the data we store is stored in page units, and the size of each page is 16K, then we should store as much data per page as possible. The width of the table structure should not be too large, that is, the number of columns should not be too large, and the number of rows is more likely to be saved, so the problem of field type selection will be involved in storing the number of rows.
The following bytes are exemplified according to utf8. A Chinese occupies 3 bytes, a number and letter are one byte, and the utf8 is long, ranging from 1 to 6.
(1) numeric processing is faster than string processing.
(2) when we need to store a fixed length value (× ×, mobile phone number) and the length is less than 50 bytes, then we can choose char (n).
(3) choose varchar (n) when we want to store values greater than 50 bytes in length.
(4) when we store time, datatime > int > char > varchar, but int has a time limit and can only be saved until 2038.
(5) the choice of float and decimal, when we need to store a value with high precision, then we have to save decimal,float only to 7 places after the decimal point
The following is the number of bytes occupied by the type
Read the above about Mysql column types and storage space, hope to give you some help in practical application. Due to the limited space in this article, it is inevitable that there will be deficiencies and need to be supplemented. If you need more professional answers, you can contact us on the official website for 24-hour pre-sales and after-sales to help you answer questions at any time.
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.