You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
227 lines
22 KiB
227 lines
22 KiB
drop table if exists dt;
|
|
CREATE TABLE dt (
|
|
id int(11) unsigned NOT NULL,
|
|
aid varchar(32) NOT NULL comment '[[set=cn.sbkcq,us.sbkcq]]',
|
|
cm int(10) unsigned NOT NULL comment '[[range=1000,5000]]',
|
|
pt varchar(10) NOT NULL comment '[[set=android,ios]]',
|
|
dic varchar(64) DEFAULT NULL,
|
|
ip varchar(15) DEFAULT NULL,
|
|
ds date DEFAULT NULL comment '[[range=2016-01-01,2016-12-31]]',
|
|
ds2 varchar(13) DEFAULT NULL ,
|
|
t int(13) DEFAULT NULL comment '[[range=1477971470,1480000000]]',
|
|
ext varchar(550) DEFAULT NULL,
|
|
p1 varchar(64) DEFAULT NULL ,
|
|
p2 varchar(64) DEFAULT NULL,
|
|
p3 varchar(64) DEFAULT NULL,
|
|
p4 varchar(64) DEFAULT NULL,
|
|
p5 varchar(64) DEFAULT NULL,
|
|
p6_md5 varchar(32) DEFAULT NULL,
|
|
p7_md5 varchar(32) DEFAULT NULL,
|
|
bm tinyint(1) DEFAULT '0' comment '[[set=0,1]]',
|
|
bgm tinyint(1) DEFAULT '0' comment '[[set=0,1]]',
|
|
insert_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (id),
|
|
UNIQUE KEY aid (aid,dic),
|
|
KEY ip (ip),
|
|
KEY cm (cm)
|
|
);
|
|
load stats 's/explain_complex_stats_dt.json';
|
|
drop table if exists st;
|
|
CREATE TABLE st (
|
|
id int(11) UNSIGNED NOT NULL,
|
|
pt varchar(10) NOT NULL comment '[[set=android,ios]]',
|
|
aid varchar(35) NOT NULL comment '[[set=cn.sbkcq,us.sbkcq]]',
|
|
cm int(10) NOT NULL comment '[[range=1000,5000]]',
|
|
ip varchar(15) DEFAULT NULL ,
|
|
dic varchar(64) DEFAULT NULL ,
|
|
dit varchar(5) DEFAULT NULL comment '[[set=win,mac,linux]]',
|
|
p1 varchar(64) DEFAULT NULL ,
|
|
p2 varchar(64) DEFAULT NULL,
|
|
p3 varchar(64) DEFAULT NULL,
|
|
p4 varchar(64) DEFAULT NULL,
|
|
p5 varchar(64) DEFAULT NULL,
|
|
p6_md5 varchar(32) DEFAULT NULL,
|
|
p7_md5 varchar(32) DEFAULT NULL,
|
|
ext varchar(550) DEFAULT NULL,
|
|
bm tinyint(1) DEFAULT '0' comment '[[set=0,1]]',
|
|
ds date NOT NULL ,
|
|
ds2 varchar(13) DEFAULT NULL ,
|
|
t int(13) NOT NULL comment '[[range=1477971470,1479144000]]',
|
|
PRIMARY KEY (id),
|
|
KEY t (t),
|
|
KEY icd (cm,ds)
|
|
);
|
|
load stats 's/explain_complex_stats_st.json';
|
|
drop table if exists dd;
|
|
CREATE TABLE dd (
|
|
id int(11) UNSIGNED NOT NULL,
|
|
aid varchar(35) NOT NULL comment '[[set=cn.sbkcq,us.sbkcq]]',
|
|
pt varchar(10) NOT NULL comment '[[set=android,ios]]',
|
|
dic varchar(64) NOT NULL,
|
|
dim varchar(32) NOT NULL ,
|
|
mac varchar(32) DEFAULT NULL ,
|
|
ip varchar(15) DEFAULT NULL ,
|
|
t int(13) DEFAULT NULL comment '[[range=1478143900,1478144000]]',
|
|
bm tinyint(1) DEFAULT '0' comment '[[set=0,1]]',
|
|
PRIMARY KEY (id),
|
|
UNIQUE KEY aid (aid,dic),
|
|
KEY ip (ip),
|
|
KEY pi (aid,dim),
|
|
KEY t (t)
|
|
);
|
|
load stats 's/explain_complex_stats_dd.json';
|
|
drop table if exists pp;
|
|
CREATE TABLE pp (
|
|
oid varchar(20) NOT NULL,
|
|
uid bigint(20) unsigned NOT NULL comment '[[set=18089709,18089710,18090780,18090781]]',
|
|
cid int(11) unsigned NOT NULL,
|
|
ppt int(11) NOT NULL DEFAULT '0' comment '[[range=1478188700,1478275300]]',
|
|
pdt int(11) DEFAULT '0',
|
|
am decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
|
|
cc decimal(10,2) NOT NULL DEFAULT '0.00',
|
|
ps tinyint(1) NOT NULL comment '[[set=0,1,2]]',
|
|
tid varchar(200) DEFAULT NULL,
|
|
ppf varchar(50) NOT NULL comment '[[set=android,ios]]',
|
|
bs tinyint(1) NOT NULL DEFAULT '0' comment '[[set=0,1]]',
|
|
bex tinyint(1) NOT NULL DEFAULT '0' comment '[[set=0,1]]',
|
|
bu int(11) NOT NULL DEFAULT '0' comment '[[set=0,1]]',
|
|
pc char(10) NOT NULL DEFAULT 'CNY',
|
|
ui int(16) NOT NULL DEFAULT '1',
|
|
cr decimal(10,4) unsigned NOT NULL DEFAULT '1.0000',
|
|
pi int(11) unsigned NOT NULL comment '[[set=510017,520017,530017]]',
|
|
si int(11) unsigned NOT NULL,
|
|
bcc int(11) NOT NULL DEFAULT '0',
|
|
acc int(11) NOT NULL DEFAULT '0',
|
|
KEY oid (oid),
|
|
KEY uid (uid),
|
|
KEY ppt (ppt),
|
|
KEY pdt (pdt),
|
|
KEY cid (cid),
|
|
KEY ps (ps),
|
|
KEY sp (uid,pi)
|
|
);
|
|
load stats 's/explain_complex_stats_pp.json';
|
|
drop table if exists rr;
|
|
CREATE TABLE rr (
|
|
aid varchar(35) NOT NULL comment '[[set=cn.sbkcq,us.sbkcq]]',
|
|
pt varchar(10) NOT NULL comment '[[set=android,ios]]',
|
|
dic varchar(64) NOT NULL ,
|
|
gid varchar(42) NOT NULL ,
|
|
acd varchar(32) NOT NULL ,
|
|
t int(13) DEFAULT NULL comment '[[range=1478180000,1480275300]]',
|
|
bm tinyint(1) DEFAULT '0' comment '[[set=0,1]]',
|
|
PRIMARY KEY (aid,dic)
|
|
);
|
|
load stats 's/explain_complex_stats_rr.json';
|
|
explain SELECT ds, p1, p2, p3, p4, p5, p6_md5, p7_md5, count(dic) as install_device FROM dt use index (cm) WHERE (ds >= '2016-09-01') AND (ds <= '2016-11-03') AND (cm IN ('1062', '1086', '1423', '1424', '1425', '1426', '1427', '1428', '1429', '1430', '1431', '1432', '1433', '1434', '1435', '1436', '1437', '1438', '1439', '1440', '1441', '1442', '1443', '1444', '1445', '1446', '1447', '1448', '1449', '1450', '1451', '1452', '1488', '1489', '1490', '1491', '1492', '1493', '1494', '1495', '1496', '1497', '1550', '1551', '1552', '1553', '1554', '1555', '1556', '1557', '1558', '1559', '1597', '1598', '1599', '1600', '1601', '1602', '1603', '1604', '1605', '1606', '1607', '1608', '1609', '1610', '1611', '1612', '1613', '1614', '1615', '1616', '1623', '1624', '1625', '1626', '1627', '1628', '1629', '1630', '1631', '1632', '1709', '1719', '1720', '1843', '2813', '2814', '2815', '2816', '2817', '2818', '2819', '2820', '2821', '2822', '2823', '2824', '2825', '2826', '2827', '2828', '2829', '2830', '2831', '2832', '2833', '2834', '2835', '2836', '2837', '2838', '2839', '2840', '2841', '2842', '2843', '2844', '2845', '2846', '2847', '2848', '2849', '2850', '2851', '2852', '2853', '2854', '2855', '2856', '2857', '2858', '2859', '2860', '2861', '2862', '2863', '2864', '2865', '2866', '2867', '2868', '2869', '2870', '2871', '2872', '3139', '3140', '3141', '3142', '3143', '3144', '3145', '3146', '3147', '3148', '3149', '3150', '3151', '3152', '3153', '3154', '3155', '3156', '3157', '3158', '3386', '3387', '3388', '3389', '3390', '3391', '3392', '3393', '3394', '3395', '3664', '3665', '3666', '3667', '3668', '3670', '3671', '3672', '3673', '3674', '3676', '3677', '3678', '3679', '3680', '3681', '3682', '3683', '3684', '3685', '3686', '3687', '3688', '3689', '3690', '3691', '3692', '3693', '3694', '3695', '3696', '3697', '3698', '3699', '3700', '3701', '3702', '3703', '3704', '3705', '3706', '3707', '3708', '3709', '3710', '3711', '3712', '3713', '3714', '3715', '3960', '3961', '3962', '3963', '3964', '3965', '3966', '3967', '3968', '3978', '3979', '3980', '3981', '3982', '3983', '3984', '3985', '3986', '3987', '4208', '4209', '4210', '4211', '4212', '4304', '4305', '4306', '4307', '4308', '4866', '4867', '4868', '4869', '4870', '4871', '4872', '4873', '4874', '4875')) GROUP BY ds, p1, p2, p3, p4, p5, p6_md5, p7_md5 ORDER BY ds2 DESC;
|
|
id estRows task access object operator info
|
|
Projection_7 21.53 root test.dt.ds, test.dt.p1, test.dt.p2, test.dt.p3, test.dt.p4, test.dt.p5, test.dt.p6_md5, test.dt.p7_md5, Column#21
|
|
└─Sort_8 21.53 root test.dt.ds2:desc
|
|
└─HashAgg_16 21.53 root group by:test.dt.ds, test.dt.p1, test.dt.p2, test.dt.p3, test.dt.p4, test.dt.p5, test.dt.p6_md5, test.dt.p7_md5, funcs:count(Column#32)->Column#21, funcs:firstrow(test.dt.ds)->test.dt.ds, funcs:firstrow(Column#34)->test.dt.ds2, funcs:firstrow(test.dt.p1)->test.dt.p1, funcs:firstrow(test.dt.p2)->test.dt.p2, funcs:firstrow(test.dt.p3)->test.dt.p3, funcs:firstrow(test.dt.p4)->test.dt.p4, funcs:firstrow(test.dt.p5)->test.dt.p5, funcs:firstrow(test.dt.p6_md5)->test.dt.p6_md5, funcs:firstrow(test.dt.p7_md5)->test.dt.p7_md5
|
|
└─IndexLookUp_17 21.53 root
|
|
├─IndexRangeScan_13(Build) 128.32 cop[tikv] table:dt, index:cm(cm) range:[1062,1062], [1086,1086], [1423,1423], [1424,1424], [1425,1425], [1426,1426], [1427,1427], [1428,1428], [1429,1429], [1430,1430], [1431,1431], [1432,1432], [1433,1433], [1434,1434], [1435,1435], [1436,1436], [1437,1437], [1438,1438], [1439,1439], [1440,1440], [1441,1441], [1442,1442], [1443,1443], [1444,1444], [1445,1445], [1446,1446], [1447,1447], [1448,1448], [1449,1449], [1450,1450], [1451,1451], [1452,1452], [1488,1488], [1489,1489], [1490,1490], [1491,1491], [1492,1492], [1493,1493], [1494,1494], [1495,1495], [1496,1496], [1497,1497], [1550,1550], [1551,1551], [1552,1552], [1553,1553], [1554,1554], [1555,1555], [1556,1556], [1557,1557], [1558,1558], [1559,1559], [1597,1597], [1598,1598], [1599,1599], [1600,1600], [1601,1601], [1602,1602], [1603,1603], [1604,1604], [1605,1605], [1606,1606], [1607,1607], [1608,1608], [1609,1609], [1610,1610], [1611,1611], [1612,1612], [1613,1613], [1614,1614], [1615,1615], [1616,1616], [1623,1623], [1624,1624], [1625,1625], [1626,1626], [1627,1627], [1628,1628], [1629,1629], [1630,1630], [1631,1631], [1632,1632], [1709,1709], [1719,1719], [1720,1720], [1843,1843], [2813,2813], [2814,2814], [2815,2815], [2816,2816], [2817,2817], [2818,2818], [2819,2819], [2820,2820], [2821,2821], [2822,2822], [2823,2823], [2824,2824], [2825,2825], [2826,2826], [2827,2827], [2828,2828], [2829,2829], [2830,2830], [2831,2831], [2832,2832], [2833,2833], [2834,2834], [2835,2835], [2836,2836], [2837,2837], [2838,2838], [2839,2839], [2840,2840], [2841,2841], [2842,2842], [2843,2843], [2844,2844], [2845,2845], [2846,2846], [2847,2847], [2848,2848], [2849,2849], [2850,2850], [2851,2851], [2852,2852], [2853,2853], [2854,2854], [2855,2855], [2856,2856], [2857,2857], [2858,2858], [2859,2859], [2860,2860], [2861,2861], [2862,2862], [2863,2863], [2864,2864], [2865,2865], [2866,2866], [2867,2867], [2868,2868], [2869,2869], [2870,2870], [2871,2871], [2872,2872], [3139,3139], [3140,3140], [3141,3141], [3142,3142], [3143,3143], [3144,3144], [3145,3145], [3146,3146], [3147,3147], [3148,3148], [3149,3149], [3150,3150], [3151,3151], [3152,3152], [3153,3153], [3154,3154], [3155,3155], [3156,3156], [3157,3157], [3158,3158], [3386,3386], [3387,3387], [3388,3388], [3389,3389], [3390,3390], [3391,3391], [3392,3392], [3393,3393], [3394,3394], [3395,3395], [3664,3664], [3665,3665], [3666,3666], [3667,3667], [3668,3668], [3670,3670], [3671,3671], [3672,3672], [3673,3673], [3674,3674], [3676,3676], [3677,3677], [3678,3678], [3679,3679], [3680,3680], [3681,3681], [3682,3682], [3683,3683], [3684,3684], [3685,3685], [3686,3686], [3687,3687], [3688,3688], [3689,3689], [3690,3690], [3691,3691], [3692,3692], [3693,3693], [3694,3694], [3695,3695], [3696,3696], [3697,3697], [3698,3698], [3699,3699], [3700,3700], [3701,3701], [3702,3702], [3703,3703], [3704,3704], [3705,3705], [3706,3706], [3707,3707], [3708,3708], [3709,3709], [3710,3710], [3711,3711], [3712,3712], [3713,3713], [3714,3714], [3715,3715], [3960,3960], [3961,3961], [3962,3962], [3963,3963], [3964,3964], [3965,3965], [3966,3966], [3967,3967], [3968,3968], [3978,3978], [3979,3979], [3980,3980], [3981,3981], [3982,3982], [3983,3983], [3984,3984], [3985,3985], [3986,3986], [3987,3987], [4208,4208], [4209,4209], [4210,4210], [4211,4211], [4212,4212], [4304,4304], [4305,4305], [4306,4306], [4307,4307], [4308,4308], [4866,4866], [4867,4867], [4868,4868], [4869,4869], [4870,4870], [4871,4871], [4872,4872], [4873,4873], [4874,4874], [4875,4875], keep order:false
|
|
└─HashAgg_11(Probe) 21.53 cop[tikv] group by:test.dt.ds, test.dt.p1, test.dt.p2, test.dt.p3, test.dt.p4, test.dt.p5, test.dt.p6_md5, test.dt.p7_md5, funcs:count(test.dt.dic)->Column#32, funcs:firstrow(test.dt.ds2)->Column#34
|
|
└─Selection_15 21.56 cop[tikv] ge(test.dt.ds, 2016-09-01 00:00:00.000000), le(test.dt.ds, 2016-11-03 00:00:00.000000)
|
|
└─TableRowIDScan_14 128.32 cop[tikv] table:dt keep order:false
|
|
explain select gad.id as gid,sdk.id as sid,gad.aid as aid,gad.cm as cm,sdk.dic as dic,sdk.ip as ip, sdk.t as t, gad.p1 as p1, gad.p2 as p2, gad.p3 as p3, gad.p4 as p4, gad.p5 as p5, gad.p6_md5 as p6, gad.p7_md5 as p7, gad.ext as ext, gad.t as gtime from st gad join (select id, aid, pt, dic, ip, t from dd where pt = 'android' and bm = 0 and t > 1478143908) sdk on gad.aid = sdk.aid and gad.ip = sdk.ip and sdk.t > gad.t where gad.t > 1478143908 and gad.bm = 0 and gad.pt = 'android' group by gad.aid, sdk.dic limit 2500;
|
|
id estRows task access object operator info
|
|
Projection_13 424.00 root test.st.id, test.dd.id, test.st.aid, test.st.cm, test.dd.dic, test.dd.ip, test.dd.t, test.st.p1, test.st.p2, test.st.p3, test.st.p4, test.st.p5, test.st.p6_md5, test.st.p7_md5, test.st.ext, test.st.t
|
|
└─Limit_16 424.00 root offset:0, count:2500
|
|
└─HashAgg_19 424.00 root group by:test.dd.dic, test.st.aid, funcs:firstrow(test.st.id)->test.st.id, funcs:firstrow(test.st.aid)->test.st.aid, funcs:firstrow(test.st.cm)->test.st.cm, funcs:firstrow(test.st.p1)->test.st.p1, funcs:firstrow(test.st.p2)->test.st.p2, funcs:firstrow(test.st.p3)->test.st.p3, funcs:firstrow(test.st.p4)->test.st.p4, funcs:firstrow(test.st.p5)->test.st.p5, funcs:firstrow(test.st.p6_md5)->test.st.p6_md5, funcs:firstrow(test.st.p7_md5)->test.st.p7_md5, funcs:firstrow(test.st.ext)->test.st.ext, funcs:firstrow(test.st.t)->test.st.t, funcs:firstrow(test.dd.id)->test.dd.id, funcs:firstrow(test.dd.dic)->test.dd.dic, funcs:firstrow(test.dd.ip)->test.dd.ip, funcs:firstrow(test.dd.t)->test.dd.t
|
|
└─HashJoin_28 424.00 root inner join, equal:[eq(test.st.aid, test.dd.aid) eq(test.st.ip, test.dd.ip)], other cond:gt(test.dd.t, test.st.t)
|
|
├─TableReader_31(Build) 424.00 root data:Selection_30
|
|
│ └─Selection_30 424.00 cop[tikv] eq(test.st.bm, 0), eq(test.st.pt, "android"), gt(test.st.t, 1478143908), not(isnull(test.st.ip))
|
|
│ └─TableRangeScan_29 1999.00 cop[tikv] table:gad range:[0,+inf], keep order:false
|
|
└─TableReader_38(Probe) 455.80 root data:Selection_37
|
|
└─Selection_37 455.80 cop[tikv] eq(test.dd.bm, 0), eq(test.dd.pt, "android"), gt(test.dd.t, 1478143908), not(isnull(test.dd.ip)), not(isnull(test.dd.t))
|
|
└─TableRangeScan_36 2000.00 cop[tikv] table:dd range:[0,+inf], keep order:false
|
|
explain select gad.id as gid,sdk.id as sid,gad.aid as aid,gad.cm as cm,sdk.dic as dic,sdk.ip as ip, sdk.t as t, gad.p1 as p1, gad.p2 as p2, gad.p3 as p3, gad.p4 as p4, gad.p5 as p5, gad.p6_md5 as p6, gad.p7_md5 as p7, gad.ext as ext from st gad join dd sdk on gad.aid = sdk.aid and gad.dic = sdk.mac and gad.t < sdk.t where gad.t > 1477971479 and gad.bm = 0 and gad.pt = 'ios' and gad.dit = 'mac' and sdk.t > 1477971479 and sdk.bm = 0 and sdk.pt = 'ios' limit 3000;
|
|
id estRows task access object operator info
|
|
Projection_10 170.34 root test.st.id, test.dd.id, test.st.aid, test.st.cm, test.dd.dic, test.dd.ip, test.dd.t, test.st.p1, test.st.p2, test.st.p3, test.st.p4, test.st.p5, test.st.p6_md5, test.st.p7_md5, test.st.ext
|
|
└─Limit_13 170.34 root offset:0, count:3000
|
|
└─IndexJoin_18 170.34 root inner join, inner:IndexLookUp_17, outer key:test.st.aid, inner key:test.dd.aid, equal cond:eq(test.st.aid, test.dd.aid), eq(test.st.dic, test.dd.mac), other cond:lt(test.st.t, test.dd.t)
|
|
├─TableReader_25(Build) 170.34 root data:Selection_24
|
|
│ └─Selection_24 170.34 cop[tikv] eq(test.st.bm, 0), eq(test.st.dit, "mac"), eq(test.st.pt, "ios"), gt(test.st.t, 1477971479), not(isnull(test.st.dic))
|
|
│ └─TableRangeScan_23 1999.00 cop[tikv] table:gad range:[0,+inf], keep order:false
|
|
└─IndexLookUp_17(Probe) 1.00 root
|
|
├─IndexRangeScan_14(Build) 3.93 cop[tikv] table:sdk, index:aid(aid, dic) range: decided by [eq(test.dd.aid, test.st.aid)], keep order:false
|
|
└─Selection_16(Probe) 1.00 cop[tikv] eq(test.dd.bm, 0), eq(test.dd.pt, "ios"), gt(test.dd.t, 1477971479), not(isnull(test.dd.mac)), not(isnull(test.dd.t))
|
|
└─TableRowIDScan_15 3.93 cop[tikv] table:sdk keep order:false
|
|
explain SELECT cm, p1, p2, p3, p4, p5, p6_md5, p7_md5, count(1) as click_pv, count(DISTINCT ip) as click_ip FROM st WHERE (t between 1478188800 and 1478275200) and aid='cn.sbkcq' and pt='android' GROUP BY cm, p1, p2, p3, p4, p5, p6_md5, p7_md5;
|
|
id estRows task access object operator info
|
|
Projection_5 39.28 root test.st.cm, test.st.p1, test.st.p2, test.st.p3, test.st.p4, test.st.p5, test.st.p6_md5, test.st.p7_md5, Column#20, Column#21
|
|
└─HashAgg_6 39.28 root group by:test.st.cm, test.st.p1, test.st.p2, test.st.p3, test.st.p4, test.st.p5, test.st.p6_md5, test.st.p7_md5, funcs:count(1)->Column#20, funcs:count(distinct test.st.ip)->Column#21, funcs:firstrow(test.st.cm)->test.st.cm, funcs:firstrow(test.st.p1)->test.st.p1, funcs:firstrow(test.st.p2)->test.st.p2, funcs:firstrow(test.st.p3)->test.st.p3, funcs:firstrow(test.st.p4)->test.st.p4, funcs:firstrow(test.st.p5)->test.st.p5, funcs:firstrow(test.st.p6_md5)->test.st.p6_md5, funcs:firstrow(test.st.p7_md5)->test.st.p7_md5
|
|
└─IndexLookUp_13 39.38 root
|
|
├─IndexRangeScan_10(Build) 160.23 cop[tikv] table:st, index:t(t) range:[1478188800,1478275200], keep order:false
|
|
└─Selection_12(Probe) 39.38 cop[tikv] eq(test.st.aid, "cn.sbkcq"), eq(test.st.pt, "android")
|
|
└─TableRowIDScan_11 160.23 cop[tikv] table:st keep order:false
|
|
explain select dt.id as id, dt.aid as aid, dt.pt as pt, dt.dic as dic, dt.cm as cm, rr.gid as gid, rr.acd as acd, rr.t as t,dt.p1 as p1, dt.p2 as p2, dt.p3 as p3, dt.p4 as p4, dt.p5 as p5, dt.p6_md5 as p6, dt.p7_md5 as p7 from dt dt join rr rr on (rr.pt = 'ios' and rr.t > 1478185592 and dt.aid = rr.aid and dt.dic = rr.dic) where dt.pt = 'ios' and dt.t > 1478185592 and dt.bm = 0 limit 2000;
|
|
id estRows task access object operator info
|
|
Projection_10 428.32 root test.dt.id, test.dt.aid, test.dt.pt, test.dt.dic, test.dt.cm, test.rr.gid, test.rr.acd, test.rr.t, test.dt.p1, test.dt.p2, test.dt.p3, test.dt.p4, test.dt.p5, test.dt.p6_md5, test.dt.p7_md5
|
|
└─Limit_13 428.32 root offset:0, count:2000
|
|
└─IndexJoin_19 428.32 root inner join, inner:IndexLookUp_18, outer key:test.dt.aid, test.dt.dic, inner key:test.rr.aid, test.rr.dic, equal cond:eq(test.dt.aid, test.rr.aid), eq(test.dt.dic, test.rr.dic)
|
|
├─TableReader_44(Build) 428.32 root data:Selection_43
|
|
│ └─Selection_43 428.32 cop[tikv] eq(test.dt.bm, 0), eq(test.dt.pt, "ios"), gt(test.dt.t, 1478185592), not(isnull(test.dt.dic))
|
|
│ └─TableRangeScan_42 2000.00 cop[tikv] table:dt range:[0,+inf], keep order:false
|
|
└─IndexLookUp_18(Probe) 1.00 root
|
|
├─IndexRangeScan_15(Build) 1.00 cop[tikv] table:rr, index:PRIMARY(aid, dic) range: decided by [eq(test.rr.aid, test.dt.aid) eq(test.rr.dic, test.dt.dic)], keep order:false
|
|
└─Selection_17(Probe) 1.00 cop[tikv] eq(test.rr.pt, "ios"), gt(test.rr.t, 1478185592)
|
|
└─TableRowIDScan_16 1.00 cop[tikv] table:rr keep order:false
|
|
explain select pc,cr,count(DISTINCT uid) as pay_users,count(oid) as pay_times,sum(am) as am from pp where ps=2 and ppt>=1478188800 and ppt<1478275200 and pi in ('510017','520017') and uid in ('18089709','18090780') group by pc,cr;
|
|
id estRows task access object operator info
|
|
Projection_5 207.86 root test.pp.pc, test.pp.cr, Column#22, Column#23, Column#24
|
|
└─HashAgg_6 207.86 root group by:test.pp.cr, test.pp.pc, funcs:count(distinct test.pp.uid)->Column#22, funcs:count(test.pp.oid)->Column#23, funcs:sum(test.pp.am)->Column#24, funcs:firstrow(test.pp.pc)->test.pp.pc, funcs:firstrow(test.pp.cr)->test.pp.cr
|
|
└─IndexLookUp_17 207.86 root
|
|
├─IndexRangeScan_14(Build) 627.00 cop[tikv] table:pp, index:ps(ps) range:[2,2], keep order:false
|
|
└─Selection_16(Probe) 207.86 cop[tikv] ge(test.pp.ppt, 1478188800), in(test.pp.pi, 510017, 520017), in(test.pp.uid, 18089709, 18090780), lt(test.pp.ppt, 1478275200)
|
|
└─TableRowIDScan_15 627.00 cop[tikv] table:pp keep order:false
|
|
drop table if exists tbl_001;
|
|
CREATE TABLE tbl_001 (a int, b int);
|
|
load stats 's/explain_complex_stats_tbl_001.json';
|
|
drop table if exists tbl_002;
|
|
CREATE TABLE tbl_002 (a int, b int);
|
|
load stats 's/explain_complex_stats_tbl_002.json';
|
|
drop table if exists tbl_003;
|
|
CREATE TABLE tbl_003 (a int, b int);
|
|
load stats 's/explain_complex_stats_tbl_003.json';
|
|
drop table if exists tbl_004;
|
|
CREATE TABLE tbl_004 (a int, b int);
|
|
load stats 's/explain_complex_stats_tbl_004.json';
|
|
drop table if exists tbl_005;
|
|
CREATE TABLE tbl_005 (a int, b int);
|
|
load stats 's/explain_complex_stats_tbl_005.json';
|
|
drop table if exists tbl_006;
|
|
CREATE TABLE tbl_006 (a int, b int);
|
|
load stats 's/explain_complex_stats_tbl_006.json';
|
|
drop table if exists tbl_007;
|
|
CREATE TABLE tbl_007 (a int, b int);
|
|
load stats 's/explain_complex_stats_tbl_007.json';
|
|
drop table if exists tbl_008;
|
|
CREATE TABLE tbl_008 (a int, b int);
|
|
load stats 's/explain_complex_stats_tbl_008.json';
|
|
drop table if exists tbl_009;
|
|
CREATE TABLE tbl_009 (a int, b int);
|
|
load stats 's/explain_complex_stats_tbl_009.json';
|
|
explain select sum(a) from (select * from tbl_001 union all select * from tbl_002 union all select * from tbl_003 union all select * from tbl_004 union all select * from tbl_005 union all select * from tbl_006 union all select * from tbl_007 union all select * from tbl_008 union all select * from tbl_009) x group by b;
|
|
id estRows task access object operator info
|
|
HashAgg_34 18000.00 root group by:Column#32, funcs:sum(Column#31)->Column#30
|
|
└─Projection_63 18000.00 root cast(Column#28, decimal(65,0) BINARY)->Column#31, Column#29
|
|
└─Union_35 18000.00 root
|
|
├─TableReader_38 2000.00 root data:TableFullScan_37
|
|
│ └─TableFullScan_37 2000.00 cop[tikv] table:tbl_001 keep order:false
|
|
├─TableReader_41 2000.00 root data:TableFullScan_40
|
|
│ └─TableFullScan_40 2000.00 cop[tikv] table:tbl_002 keep order:false
|
|
├─TableReader_44 2000.00 root data:TableFullScan_43
|
|
│ └─TableFullScan_43 2000.00 cop[tikv] table:tbl_003 keep order:false
|
|
├─TableReader_47 2000.00 root data:TableFullScan_46
|
|
│ └─TableFullScan_46 2000.00 cop[tikv] table:tbl_004 keep order:false
|
|
├─TableReader_50 2000.00 root data:TableFullScan_49
|
|
│ └─TableFullScan_49 2000.00 cop[tikv] table:tbl_005 keep order:false
|
|
├─TableReader_53 2000.00 root data:TableFullScan_52
|
|
│ └─TableFullScan_52 2000.00 cop[tikv] table:tbl_006 keep order:false
|
|
├─TableReader_56 2000.00 root data:TableFullScan_55
|
|
│ └─TableFullScan_55 2000.00 cop[tikv] table:tbl_007 keep order:false
|
|
├─TableReader_59 2000.00 root data:TableFullScan_58
|
|
│ └─TableFullScan_58 2000.00 cop[tikv] table:tbl_008 keep order:false
|
|
└─TableReader_62 2000.00 root data:TableFullScan_61
|
|
└─TableFullScan_61 2000.00 cop[tikv] table:tbl_009 keep order:false
|
|
|