MySQL database size estimation

I have an application database with a table for users (1 kilobyte of data per user based on count fields * typelength) and about 100 things of the same size that belong to the user (0.5 kbytes per thing), and it is in "user" table and table "thing".

This is likely to result in approximately 51 kilobytes of data for each user. However, I heard that for MySQL, I have to double it to cover index tables, which will lead me to 102kbytes / user. It's true? Are there any other data extension factors for MySQL or 102 kbytes?

Besides the indexing coefficient (which, it seems to me, 2), and storage efficiency (which I also think 2), are there other factors for storing data in MySQL?

+6
source share
1 answer

Short answer
An increase in size 2-3 times higher than MyISAM is common, 4 times rare.

All About InnODB Engine:
http://dev.mysql.com/doc/refman/5.1/en/innodb-storage-engine.html

InnoDB, MyISAM and disk space:
http://mysqlha.blogspot.com/2009/01/innodb-myisam-and-disk-space_16.html

Comparison of use of space of engines of MySQL:
Part 1: http://marksverbiage.blogspot.com/2008/02/mysql-engines-and-space-usage.html
Part2: http://marksverbiage.blogspot.com/2008/04/mysql-engines-space-usage-comparison.html

Here is the physical structure of the line:
http://dev.mysql.com/doc/refman/5.0/en/innodb-physical-record.html

There are many variables and problems:

  • Indexes, remember that InnoDB includes a PC in each secondary index.
  • Will you pack the keys (slowly)?
  • Is the table redundant?
  • Don't forget about the logs (binary log, slow query log, error log).
  • Are the rows declared NULL, if so, add an extra byte in the column with a null value for each row.
  • What encoding do you use?
+2
source

Source: https://habr.com/ru/post/896738/


All Articles