Good point. You’re correct, but I think the author’s definition of “very short” strings is definitely way less than 255.
Also, a note throughout the book, it’s referencing mysql 5.7 (at least for the version I have read). They don’t differ on this particular detail tho.
When you mention row fragmentation while comparing char and VARCHAR, you mean storing some columns in off-page storage (overflow pages), right?
If so, the CHAR type can also be fragmented when using a
CHAR(255)in utf8mb4 character set (default in MySQL) which has a max of 4 bytes per character (4*255=1020 > 768). Fixed-length fields greater than or equal to 768 bytes are encoded as variable-length fields. So the CHAR type is actually prone to fragmentation.dev.mysql.com/doc/refman/8.3/en/innodb-row-format…
Correct me if I am wrong or misunderstood. By the way, I am really enjoying the series so far.