A long VARCHAR
is stored in the same manner as a TEXT
/BLOB
field in InnoDB
(which I assume you're using for transactionality, referential integrity and crash recovery, right?) - that is, externally to the rest of the table on disk (which may require another disk read to retrieve).
From storage prospective BLOB, TEXT as
well as long VARCHAR are handled same
way by Innodb. This is why Innodb
manual calls it “long columns” rather
than BLOBs.
source
Unless you need to index these columns (in which case VARCHAR
is much faster) there is no reason to use VARCHAR
over TEXT
for long fields - there are some engine specific optimisations in MySQL
to tune the data retrieval according to length, and you should use the correct column type to take advantage of these.
In case you're using MyISAM
an in-depth discussion on the topic is here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…