I have a huge table in MySQL and am looking to make it smaller by optimizing the data.
Now I was wondering if MySQL has features that allow me to calculate how many bytes I would save by deleting certain rows or columns?
So something like: select bytes_used(*) from (subquery...), or something like this?
I can of course duplicate the table and compare the storage used after deleting the rows or columns, but that takes up a lot of time. Some data I can migrate or delete and build differently in the app without breaking anything.
This question is about assessing the possible gains and if this course of action is worth pursuing.
Any other help regarding calculation of disk space with MySQL data is also very welcome. I know that you can see how much data a table takes up in phpMyAdmin, but I'm looking further than this.
Addendum: I'm looking for data size on the row or column level, not whole tables.
LENGTH(varchar_field)
will return byte length – Dardar