79664401

Date: 2025-06-13 05:59:48
Score: 0.5
Natty:
Report link

TEXT

There are three sizes: TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT.

Type Size (bytes)
TINYTEXT 255
TEXT 65535
MEDIUMTEXT 16777215
LONGTEXT 4294967295

With the exception of TINYTEXT, The others are stored off-page, and it is harder to index these values. Text is great for things like storing posts, articles, novels, etc...except for TINYTEXT of course.

Breaking this down Barney-style, Text is:

VARCHAR

VarChar is similar to TINYTEXT in size, 255 Bytes. Unlike it's TEXT cousin, it does not store off-page. Unlike with TEXT, you can restrict length by doing something like VARCHAR(30). Just setting VARCHAR will set it at max (255).

Again, Barney-style:

Which one should I use?

Depends on what data you expect you need to be stored and what database you're using. Postgres for example only uses Text as it handles Text types differently.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: c0dezer019