开发者

char vs tinytext

开发者 https://www.devze.com 2023-01-06 09:34 出处:网络
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.

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号