Notifications
Sign Up Sign In
Q&A

How to calculate how much data is stored in a MySQL column?

+2
−0

I am considering either removing some columns or changing the datatypes if I could significantly reduce the amount of storage that is currently used by those columns. Some of the columns are ints and some are varchar.

How do I calculate (preferably in megabytes) the amount of storage a column uses?

Why should this post be closed?

4 comments

Depends on the storage engine. Which one do you use? Have you seen this page? https://dev.mysql.com/doc/refman/8.0/en/storage-requirements.html ‭jcsahnwaldt‭ about 1 month ago

@jcsahn InnoDB, yes ‭Charlie Brumbaugh‭ about 1 month ago

If you have seen that page, what is still unclear? It seems to contain all the info you are looking for? ‭meriton‭ about 1 month ago

@meriton that page is useful for calculating how much space adding other int column with all rows filled will take, less useful for how much space a varchar column where the length of the strings is not constant ‭Charlie Brumbaugh‭ about 1 month ago

0 answers

Sign up to answer this question »