Myisam指数手动计算

时间:2014-01-26 19:35:13

标签: mysql indexing size

我有一个包含25亿行的表,并且有一个二进制(16)索引,它的索引大小为18G。

所以我将索引更改为mediumint,跳转索引大小下降5倍左右。 但是在转换3day之后,生成的表索引大小为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) */;

0 个答案:

没有答案