In Mysql, varchar and text note Varchar occupy two bytes for each English (ASCII) character, and one Chinese character only occupies two bytes for char and one English (ASCII) character, the type of a Chinese character that occupies 2 bytes of Varchar is not filled with spaces, for example, varchar (100), but its value is only "n ", then its value is "n" and char is different, for example, char (100), its value is "n ", in fact, it is "n" in the database (there are 99 spaces after n, that is, it is filled with 100 bytes ). Char is of a fixed length, so it is much faster than varchar! However, it is a little troublesome for the program to process it. We need to use functions such as trim to remove spaces on both sides! Note that for the encoded char (N)/varchar (N), N indicates the maximum number of characters allowed in the current column. not the number of bytes. the text type can be divided into tinytext (255 length), smalltext (65535), midumtext (int maximum), and longtext (long maximum ). in mysql, the storage of text data is somewhat different from that of varchar/char. text data is stored outside the metadata table, however, varchar/char is stored in the table data file together with other columns. in fact, the text data type will greatly increase the size of the database table file, which has some impact on physical storage. Meanwhile, text data retrieval and IO output will also increase competition for memory. most of the time, we recommend that you store the text type, especially the data with a large length or frequent changes, on other proprietary platforms, such as NOSQL .. in essence, mysql is not suitable for text storage, but in many cases, we expect mysql to provide more efficient small data query/transaction processing.