8

Hi folks I've a doubt in mysql file dump size and db size varies.

My DB size is 238MB and same DB's dump size is 297MB. Why this large variations?. Can any one explain this?.

1

3 Answers 3

10

The dump file is a text file. When you turn the internal data of a DB into text, there are many expansions:

  • Numbers that might be 4 bytes internally are written out as digits like 123456
  • Strings have quotes around them, and special characters in the strings may be escaped
  • There are commas between each column, and parentheses around the rows
Sign up to request clarification or add additional context in comments.

Comments

8

When you run mysqldump, only data is dumped in SQL statements. Indexed are not copied. Indexes get rebuilt when the SQL is loaded into another server.

3 Comments

why the size is reduced in DB ?
Generally DB's dump size less then actual DB size.
@Hoja you can read details description about your issue here.dba.stackexchange.com/questions/4582/…
4

For a good normalized db, db size is significantly smaller than dump file.

Because the db uses a lot of numbers, I have a db with 200 mb dump, but only 80 kb in db.

As said by Barmar, during dump, numbers are converted into characters, 1234567891 uses 1 integer for storage, or 3 bytes, but 10 bytes for the characters.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.