Comment by kijin

2 hours ago

> Pascal strings, where the length is stored in the 0th character, were much worse

Until unicode became widely supported, many databases used to reserve 1 byte for the length of a VARCHAR, typically at the 0th position of the column. The content was understandably limited to 255 characters.

Because of that extra byte per row, it is considered a waste of memory to use VARCHAR for data that is expected to be fixed-length. Well, it's an even larger waste in some cases. A certain popular ORM continues to insist on mapping UUID to VARCHAR(36), wasting a whopping 21 bytes per row! Certainly something to keep in mind at a time when both RAM and disks are expensive.

SQLite of course doesn't care, and stores all string as TEXT.