我有一个托管在 Google Cloud SQL 上的 MySQL 表,其中包含超过 10 亿行。
>> SHOW CREATE TABLE depth
CREATE TABLE `depth` (
`date` date DEFAULT NULL,
`receive_time` datetime(3) DEFAULT NULL,
`instrument_token` bigint(20) unsigned DEFAULT NULL,
`level` tinyint(3) unsigned DEFAULT NULL,
`bid_count` smallint(5) unsigned DEFAULT NULL,
`bid_size` bigint(20) unsigned DEFAULT NULL,
`bid_price` float DEFAULT NULL,
`ask_price` float DEFAULT NULL,
`ask_size` bigint(20) unsigned DEFAULT NULL,
`ask_count` smallint(5) unsigned DEFAULT NULL,
KEY `date_time_sym` (`date`,`receive_time`,`instrument_token`),
KEY `date_sym_time` (`date`,`instrument_token`,`receive_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
Run Code Online (Sandbox Code Playgroud)
为了获取数据和索引大小,我运行查询
SHOW TABLE STATUS from mktdata …Run Code Online (Sandbox Code Playgroud)