小编teo*_*ing的帖子

计算Mysql Ndb Cluster表大小

我试图在 mysql ndb 集群中计算我的表的表行大小。正如文档所说,该值由 IndexMemory + DataMemory + 每行开销 16 个字节 + 每个 DataMemory 页 128 个字节组成。

我的 NDB Cluster 配置:服务器版本:5.6.25-ndb-7.4.7-cluster-gpl-log MySQL Cluster Community Server (GPL)

NoOfReplica: 1

节点数:1

数据内存:2Gb

索引内存:512Mb

其他默认值。

所有数据都存储在 RAM 中。

我已经使用测试表将 ndb 集群填充到其极限。

CREATE TABLE `clients` ( 
`id`bigint(20) NOT NULL AUTO_INCREMENT
`user_id` bigint(20) NOT NULL,   
PRIMARY KEY (`id`) )
ENGINE=ndbcluster AUTO_INCREMENT=5 DEFAULT CHARSET=utf8
COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;
Run Code Online (Sandbox Code Playgroud)

我对这张表的计算:

DataMemory:8(bigint)+8(bigint)+10(主键的有序索引)+16(开销)=42字节

IndexMemory:25(主键的哈希索引)= 25 字节

ndb_mgm> 所有报告内存

节点 11:数据使用率为 95%(62260 32K 页共 65536 页)

节点 11:索引使用率为 76%(50017 8K 页共 65600 …

mysql cluster-computing

5
推荐指数
0
解决办法
925
查看次数

标签 统计

cluster-computing ×1

mysql ×1