I've googled this and can't find it, you can see Rick James mention it here.
...
BLOB
andTEXT
are not always stored separately
The answer on What is the difference between MySQL VARCHAR and TEXT data types? says,
InnoDB is similar for
VARCHAR
, but stores the completeTEXT
field outside of the record.
That's not the only massively upvote answer with this stance. From StackOverflow you can find an answer with 754 upvotes that says it quite clearly,
TEXT
andBLOB
is stored off the table with the table just having a pointer to the location of the actual storage.
VARCHAR
is stored inline with the table.VARCHAR
is faster when the size is reasonable, the tradeoff of which would be faster depends upon your data and your hardware, you'd want to benchmark a realworld scenario with your data.
The comment here links to a post on a mailing list that says
MyISAM puts
TEXT
andBLOB
'inline'. If you are searching a table (range scan / table scan), you are 'stepping over those cow paddies' -- costly for disk I/O. That is, the existence of the inline blob hurts performance in this case.InnoDB puts only 767 bytes of a
TEXT
orBLOB
inline, the rest goes into some other block. This is a compromise that sometimes helps, sometimes hurts performance.
I've seen other posts that talk about storing text and blobs in-line if they're under some limit? What is the limit? When, if ever, does InnoDB store blobs and texts in line?