What's the difference between VARCHAR(255) and TINYTEXT string types in MySQL?

后端 未结 3 1299
再見小時候
再見小時候 2020-12-04 23:39

What\'s the difference between VARCHAR(255) and TINYTEXT string types in MySQL?

Each of them allows to store strings with a maximum length of 255 characters. Storage

3条回答
  •  青春惊慌失措
    2020-12-05 00:22

    You cannot assign a DEFAULT value to a TINYTEXT and you cannot create an unprefixed index on the latter.

    Internally, additional objects are allocated in memory to handle TEXT (incl. TINYTEXT) columns which can cause memory fragmentation on the large recordsets.

    Note that this only concerns the column's internal representation in the recordsets, not how they are stored on the disk.

提交回复
热议问题