I have converted a MySQL database with 80.000.000 rows to TokuDB.
Now when I run:
select count(id) from xxx where active=1
it takes 90% of the time of the normal MySQL request.
What do I have to further optimize so that it runs faster?
The table definition:
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` varchar(15) NOT NULL,
`clicks` int(11) NOT NULL DEFAULT '0',
`clickTimeLast` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`tag` varchar(256) NOT NULL,
`countryShort` varchar(2) NOT NULL,
`timeCreated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`timeUpdated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `uid` (`uid`),
KEY `_campaign` (`_campaign`),
KEY `_ad` (`_ad`),
KEY `_adsDelivered` (`_adsDelivered`),
KEY `session` (`session`),
KEY `tag` (`tag`),
KEY `ip` (`ip`),
KEY `countryShort` (`countryShort`),
KEY `refererDomain` (`refererDomain`)
) ENGINE=TokuDB AUTO_INCREMENT=7420143 DEFAULT CHARSET=utf8;