hi, all
as we analyzer a website's visitors, for example, we need show these data in the report:
pv, sessions, visitors, browser, geo, referer (and more)
if we use MySQL, for best performance, we will split the data into the small dimension table:
CREATE TABLE `trend_browser` (
`date` int(11) NOT NULL DEFAULT '0',
`hour` tinyint(4) NOT NULL DEFAULT '0',
`ips` int(11) unsigned NOT NULL DEFAULT '0',
`pageviews` int(11) unsigned NOT NULL DEFAULT '0',
`sessions` int(11) unsigned NOT NULL DEFAULT '0',
`visitors` int(11) unsigned NOT NULL DEFAULT '0',
`browser_id` int(11) unsigned NOT NULL DEFAULT '0',
`browser_version` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`date`,`browser_id`,`browser_version`,`hour`)
) ENGINE=MyISAM;
CREATE TABLE `trend_geo` (
`date` int(11) NOT NULL DEFAULT '0',
`hour` tinyint(4) NOT NULL DEFAULT '0',
`ips` int(11) unsigned NOT NULL DEFAULT '0',
`pageviews` int(11) unsigned NOT NULL DEFAULT '0',
`sessions` int(11) unsigned NOT NULL DEFAULT '0',
`visitors` int(11) unsigned NOT NULL DEFAULT '0',
`country_id` int(5) unsigned NOT NULL DEFAULT '0',
`region_id` int(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`date`,`country_id`,`region_id`,`hour`)
) ENGINE=MyISAM;
CREATE TABLE `trend_referer` (
`date` int(11) NOT NULL DEFAULT '0',
`hour` tinyint(4) NOT NULL DEFAULT '0',
`ips` int(11) unsigned NOT NULL DEFAULT '0',
`pageviews` int(11) unsigned NOT NULL DEFAULT '0',
`sessions` int(11) unsigned NOT NULL DEFAULT '0',
`visitors` int(11) unsigned NOT NULL DEFAULT '0',
`referer_host_id` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`date`,`referer_host_id`,`hour`)
) ENGINE=MyISAM;
these table just for an example, in practice, these data has 50+ Dimension and 20+ Metrics.
so, in druid, may be we can put all the Dimension and Metrics in one segment ?
or just split Dimensions to small segments like what we do in MySQL ?
--
@QLeelulu | FaWave, Net4 Team | qlee...@gmail.com | 学海无涯,回头是岸