I would like to know if I use LONGTEXT instead of VARCHAR (255) would cause more lag, which would have a greater advantage ??
I would like to know if I use LONGTEXT instead of VARCHAR (255) would cause more lag, which would have a greater advantage ??
Yes, it makes a difference.
These two types of data are stored differently in the database and have different functions. For example, you can index a column of type VARCHAR
, but you can not index a column of type TEXT
or LONGTEXT
Only use LONGTEXT
if it is to store a large amount of text in this column (it can store up to 4GB). Otherwise, for simpler textual information, prefer VARCHAR
.