What is the difference between char and tinytext in开发者_JAVA百科 MySQL?
char[]
is fixed and tinytext is variable up to 255 characters.
One difference is the way MySQL stores the data.
For a TEXT field, MySQL will allocate 256 bytes in the original table and then store the remainder of the data in 2,000 byte chunks in a separate, hidden table.
For a CHAR field, you must declare the fixed size when creating the table (up to 256) and MySQL will always use this amount of space to store each record (padding with spaces as needed).
精彩评论