开发者

char vs tinytext

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜