Understanding data length How does the LENGTH() query relate to actual size of the data?
I notice that when I save this data to a text file, it's approximately 2% larger than the LENGTH() query.  What is happening here?  Here's an example on linux using MariaDB 10.3.16.
du and ls both agree`.
$ mysql -ufugu -p projects -e &quot;SELECT ID, LENGTH(CutXML) as length FROM renders ORDER BY length DESC LIMIT 1&quot;
Enter password: 
+-----+---------+
| ID  | length  |
+-----+---------+
| 350 | 3431670 |
+-----+---------+
$ mysql -ufugu -p projects -e &quot;SELECT CutXML FROM renders WHERE ID=350&quot; &gt; cut.xml
Enter password: 
$ ls -al cut.xml 
-rw-r--r--. 1 root root 3512937 Aug 20 14:23 cut.xml
$ du -b cut.xml 
3512937 cut.xml
Only 2%?
Check the line terminators.  For the column, do something like SELECT HEX(LEFT(COL(100))).  For the file, do something like od or hd or take the cat to the vet (cat -vet).
A Rule of Thumb is that an average line of &quot;text&quot; is 30 characters, which would lead to about a 3% difference.  XML is rather verbose, and your data may be averaging 50 bytes per &quot;line&quot;.