MySQL 数据库大小估算
我有一个应用程序数据库,其中有一个用户表(每个用户 1kbyte 的数据,基于计数字段 * typelength),大约 100 个属于用户的相同大小的事物(每个事物 0.5 kbyte),并且它位于“用户”表和“事物”表。
这似乎会导致每个用户产生大约 51kb 的数据。但是,我听说对于 MySQL,我应该将其加倍以覆盖索引表,这将使我达到 102kbytes/user 这是真的吗? MySQL 是否还需要考虑其他数据扩展因素,或者 102 KB 是一个不错的估计吗?
除了索引因子(我认为是2)和存储效率(我也认为是2)之外,MySQL中的数据存储还有其他乘数吗?
I have an application database with a table for users (1kbyte of data per user based on counting fields * typelength), and about 100 things of the same size belonging to a user (0.5 kbyte per thing), and it is in a "user" table and a "thing" table.
That would seem to lead to about 51kbytes of data per user. However, I have heard that for MySQL, I should double it to cover index tables, which would get me to 102kbytes/user Is that true? Are there any other data expansion factors to consider for MySQL, or is 102 kbytes a good estimate?
Besides the indexing factor (which I think is 2) and the storage efficiency (which I also think is 2), are there any other multipliers for data storage in MySQL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短回答
大小比 MyISAM 增加 2-3 倍是常见的,4 倍是罕见的。
关于 InnODB 引擎的一切:
http://dev.mysql.com/doc/refman /5.1/en/innodb-storage-engine.html
InnoDB、MyISAM 和磁盘空间:
http://mysqlha.blogspot.com/2009/01 /innodb-myisam-and-disk-space_16.html
MySQL引擎空间使用比较:
第 1 部分: http://marksverbiage.blogspot.com/2008 /02/mysql-engines-and-space-usage.html
第2部分: http://marksverbiage.blogspot.com/2008 /04/mysql-engines-space-usage-comparison.html
这是物理行结构:
http://dev.mysql.com/doc/refman /5.0/en/innodb-physical-record.html
有很多变量和问题:
Short answer
Size increase 2-3x over MyISAM is common, 4x is rare.
Everything about the 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
MySQL engines space usage comparison:
Part1: 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's the physical row structure:
http://dev.mysql.com/doc/refman/5.0/en/innodb-physical-record.html
There are a lot of variables and issues: