Joke Collection Website - Joke collection - Problems of char type in mysql
Problems of char type in mysql
In a data column of type char (m), each value takes up m bytes. If a length is less than m, MySQL will fill it with space characters on its right. (Those filled space characters will be removed in the retrieval operation) In a data column of type varchar(M), Each value only takes up just enough bytes plus one byte to record its length (that is, the total length is L+1 bytes).
Rules used in MySQL to judge whether it is necessary to convert the column type
1. In a data table, if the length of each data column is fixed, the length of each data row will also be fixed.
2. As long as there is one data column in the data table. Then the length of each data row is variable.
3. If the length of a data row in a data table is variable, MySQL will convert the fixed-length data column in this data table into the corresponding variable-length type in order to save storage space.
Exception: char data columns with a length less than 4 characters will not be converted into varchar type.
I hope it will be helpful to you.
- Related articles
- The aesthetic vision of straight men is complicated, so what kind of girls do they like?
- I can't do business.
- Can I have some funny couples' chat records?
- Sudden fat joke
- There are at least a few people performing cross talk.
- What does Heyuan say?
- Humorous jokes for men and women
- What did movie english say?
- How to write it later
- Humiliate yourself and make others laugh.