我已将具有 80.000.000 行的 MySQL 数据库转换为 TokuDB。
现在当我运行时:
select count(id) from xxx where active=1
Run Code Online (Sandbox Code Playgroud)
它占用了正常 MySQL 请求的 90% 的时间。
我需要进一步优化什么才能让它运行得更快?
表定义:
CREATE TABLE `adsDelivered` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`uid` varchar(40) NOT NULL,
`_adsDelivered` bigint(20) NOT NULL DEFAULT '0',
`_campaign` bigint(20) NOT NULL DEFAULT '0',
`_ad` bigint(20) NOT NULL DEFAULT '0',
`session` varchar(44) NOT NULL,
`referer` text NOT NULL,
`refererDomain` varchar(256) NOT NULL,
`pageTime` int(11) NOT NULL DEFAULT '0',
`pageVisibleTime` int(11) NOT NULL DEFAULT '0',
`browser` varchar(256) NOT NULL,
`ip` …
Run Code Online (Sandbox Code Playgroud)