Difference in memory requirements for TinyText and Text - MySQL

In the MySQL manual, Data Warehouse Requirements, I found:

Data Type   Storage Required
--------------------------------------------
TINYTEXT    L + 1 bytes, where L < 2^8  
TEXT        L + 2 bytes, where L < 2^16
  • If I store 240 characters [utf8-general] in TinyText, as well as in the Text field, will the Text field just eat 1 byte more than TinyText?
  • How much space will the text take if I save 1024 letters [utf8-general]?
    I think 1024 + 2 bytes!
  • Will it use the same space if I store one character or 2 ^ 16 characters in a text box?
+3
source share
2 answers
  • TinyText 255 . 63 , , 63 , 4 UTF-8. , 255 , , , ASCII UTF-8.

  • 1024 , 1024 4096 (+2) . , UTF-8, 1 4 .

  • , (U + 0000.. U + 007F), 3 (1 , 2 ) . , , 4 (, U + 101001 - , , 4 ), 6 . 2 ^ 16 .

Unicode; .

+6

Q1: yes Q2: . utf-8 1 6 . , 1024+2 .. 6144+2 . Q3: nope

+3

All Articles