Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Myisam指数手动计算_Mysql_Indexing_Size - Fatal编程技术网

Mysql Myisam指数手动计算

Mysql Myisam指数手动计算,mysql,indexing,size,Mysql,Indexing,Size,我有一个有25亿行的表,有一个二进制(16)索引,索引大小为18G 所以我把索引改为mediumint,跳跃索引的大小下降了5倍左右。 但是经过3天的转换,得到的表索引大小是16G 我做错什么了吗? 请帮忙 这是原来的桌子 CREATE TABLE `processedphrase2` ( `phrase` char(30) NOT NULL, `phraseHash` binary(16) NOT NULL, `score` smallint(6) unsigned NOT NU

我有一个有25亿行的表,有一个二进制(16)索引,索引大小为18G

所以我把索引改为mediumint,跳跃索引的大小下降了5倍左右。 但是经过3天的转换,得到的表索引大小是16G

我做错什么了吗? 请帮忙

这是原来的桌子

CREATE TABLE  `processedphrase2` (
  `phrase` char(30) NOT NULL,
  `phraseHash` binary(16) NOT NULL,
  `score` smallint(6) unsigned NOT NULL,
  `count` smallint(9) unsigned NOT NULL,
  `urlid` int(9) unsigned NOT NULL,
  `position` text CHARACTER SET ascii NOT NULL,
  KEY `phraseHash` (`phraseHash`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
这是修改过的

CREATE TABLE  `processedphrase_` (
  `phraseID` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `score` smallint(6) unsigned NOT NULL,
  `count` smallint(9) unsigned NOT NULL,
  `urlid` int(9) unsigned NOT NULL,
  `position` text CHARACTER SET ascii NOT NULL,
  KEY `phraseID` (`phraseID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
/*!50500 PARTITION BY RANGE  COLUMNS(phraseID)
(PARTITION p0 VALUES LESS THAN (1000000) ENGINE = MyISAM,
 PARTITION p1 VALUES LESS THAN (2000000) ENGINE = MyISAM,
 .......
 PARTITION pOther VALUES LESS THAN (MAXVALUE) ENGINE = MyISAM) */;

如果您有一个包含25亿行的表,那么除了索引之外,我建议使用一种性能分区方案。
mediumint
的范围仅为16777215,对于如此大的表来说似乎很小。mediumint不是唯一的。