Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

statistics: add bucket ndv for index histogram #20580

Merged
merged 23 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
425d39e
add bucket ndv for index histogram
winoros Aug 20, 2020
b4bdd72
address comments
winoros Oct 26, 2020
1430708
Merge branch 'master' into bucket-ndv-index-hist
winoros Nov 3, 2020
8655fad
Merge branch 'master' into bucket-ndv-index-hist
winoros Dec 14, 2020
7e6638e
add version control and make feedback collect work again
winoros Dec 14, 2020
05d588b
fix ndv when extract topn out of hist
winoros Dec 15, 2020
7326222
address comments and fix
winoros Dec 21, 2020
3e0fa73
Merge branch 'master' into bucket-ndv-index-hist
winoros Dec 21, 2020
da25722
address comments
winoros Dec 23, 2020
1bf0175
fix tests and adderss comments
winoros Dec 23, 2020
878b5ca
fix go mod tidy
winoros Dec 23, 2020
f3a4523
Merge branch 'master' into bucket-ndv-index-hist
winoros Dec 23, 2020
78209d3
Merge branch 'master' into bucket-ndv-index-hist
winoros Dec 24, 2020
a48e59e
Merge branch 'master' into bucket-ndv-index-hist
qw4990 Dec 24, 2020
c4809ea
Merge branch 'master' into bucket-ndv-index-hist
winoros Dec 29, 2020
48cc1bd
address comments
winoros Dec 29, 2020
ac554e0
Merge branch 'bucket-ndv-index-hist' of https://github.com/winoros/ti…
winoros Dec 29, 2020
c36ab62
Merge branch 'master' into bucket-ndv-index-hist
qw4990 Dec 30, 2020
e5f83c6
Merge branch 'master' into bucket-ndv-index-hist
winoros Jan 5, 2021
6fa4644
Merge branch 'master' into bucket-ndv-index-hist
winoros Jan 7, 2021
2fbc952
Merge branch 'master' into bucket-ndv-index-hist
ti-srebot Jan 7, 2021
566c704
Merge branch 'master' into bucket-ndv-index-hist
winoros Jan 12, 2021
12c5ccd
Merge branch 'master' into bucket-ndv-index-hist
winoros Jan 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cmd/explaintest/r/explain_complex_stats.result
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ 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
Projection_7 308.93 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 308.93 root test.dt.ds2:desc
└─HashAgg_16 308.93 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 308.93 root
├─IndexRangeScan_13(Build) 1841.60 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) 308.93 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 309.39 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 1841.60 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
Expand Down
22 changes: 11 additions & 11 deletions cmd/explaintest/r/explain_easy_stats.result
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,26 @@ TableReader_6 1999.00 root data:TableRangeScan_5
└─TableRangeScan_5 1999.00 cop[tikv] table:t1 range:(0,+inf], keep order:false
explain select t1.c1, t1.c2 from t1 where t1.c2 = 1;
id estRows task access object operator info
IndexReader_6 0.00 root index:IndexRangeScan_5
└─IndexRangeScan_5 0.00 cop[tikv] table:t1, index:c2(c2) range:[1,1], keep order:false
IndexReader_6 8.00 root index:IndexRangeScan_5
└─IndexRangeScan_5 8.00 cop[tikv] table:t1, index:c2(c2) range:[1,1], keep order:false
explain select * from t1 left join t2 on t1.c2 = t2.c1 where t1.c1 > 1;
id estRows task access object operator info
HashJoin_22 2481.25 root left outer join, equal:[eq(test.t1.c2, test.t2.c1)]
├─TableReader_36(Build) 1985.00 root data:Selection_35
│ └─Selection_35 1985.00 cop[tikv] not(isnull(test.t2.c1))
│ └─TableFullScan_34 1985.00 cop[tikv] table:t2 keep order:false
└─TableReader_33(Probe) 1998.00 root data:TableRangeScan_32
└─TableRangeScan_32 1998.00 cop[tikv] table:t1 range:(1,+inf], keep order:false
└─TableReader_33(Probe) 1991.00 root data:TableRangeScan_32
└─TableRangeScan_32 1991.00 cop[tikv] table:t1 range:(1,+inf], keep order:false
explain update t1 set t1.c2 = 2 where t1.c1 = 1;
id estRows task access object operator info
Update_3 N/A root N/A
└─Point_Get_1 1.00 root table:t1 handle:1
explain delete from t1 where t1.c2 = 1;
id estRows task access object operator info
Delete_4 N/A root N/A
└─IndexLookUp_11 0.00 root
├─IndexRangeScan_9(Build) 0.00 cop[tikv] table:t1, index:c2(c2) range:[1,1], keep order:false
└─TableRowIDScan_10(Probe) 0.00 cop[tikv] table:t1 keep order:false
└─IndexLookUp_11 8.00 root
├─IndexRangeScan_9(Build) 8.00 cop[tikv] table:t1, index:c2(c2) range:[1,1], keep order:false
└─TableRowIDScan_10(Probe) 8.00 cop[tikv] table:t1 keep order:false
explain select count(b.c2) from t1 a, t2 b where a.c1 = b.c2 group by a.c1;
id estRows task access object operator info
Projection_11 1985.00 root cast(Column#8, bigint(21) BINARY)->Column#7
Expand All @@ -80,10 +80,10 @@ TopN_7 1.00 root test.t2.c2, offset:0, count:1
└─TableFullScan_13 1985.00 cop[tikv] table:t2 keep order:false
explain select * from t1 where c1 > 1 and c2 = 1 and c3 < 1;
id estRows task access object operator info
IndexLookUp_11 0.00 root
├─IndexRangeScan_8(Build) 0.00 cop[tikv] table:t1, index:c2(c2) range:(1 1,1 +inf], keep order:false
└─Selection_10(Probe) 0.00 cop[tikv] lt(test.t1.c3, 1)
└─TableRowIDScan_9 0.00 cop[tikv] table:t1 keep order:false
IndexLookUp_11 0.51 root
├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:t1, index:c2(c2) range:(1 1,1 +inf], keep order:false
└─Selection_10(Probe) 0.51 cop[tikv] lt(test.t1.c3, 1)
└─TableRowIDScan_9 1.00 cop[tikv] table:t1 keep order:false
explain select * from t1 where c1 = 1 and c2 > 1;
id estRows task access object operator info
Selection_6 0.50 root gt(test.t1.c2, 1)
Expand Down
6 changes: 3 additions & 3 deletions cmd/explaintest/r/explain_indexmerge.result
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ label = "cop"
set session tidb_enable_index_merge = off;
explain select /*+ use_index_merge(t, primary, tb, tc) */ * from t where a <= 500000 or b <= 1000000 or c <= 3000000;
id estRows task access object operator info
IndexMerge_9 3560000.00 root
├─TableRangeScan_5(Build) 500000.00 cop[tikv] table:t range:[-inf,500000], keep order:false
IndexMerge_9 3570485.44 root
├─TableRangeScan_5(Build) 532767.00 cop[tikv] table:t range:[-inf,500000], keep order:false
├─IndexRangeScan_6(Build) 1000000.00 cop[tikv] table:t, index:tb(b) range:[-inf,1000000], keep order:false
├─IndexRangeScan_7(Build) 3000000.00 cop[tikv] table:t, index:tc(c) range:[-inf,3000000], keep order:false
└─TableRowIDScan_8(Probe) 3560000.00 cop[tikv] table:t keep order:false
└─TableRowIDScan_8(Probe) 3570485.44 cop[tikv] table:t keep order:false
explain select /*+ use_index_merge(t, tb, tc) */ * from t where b < 50 or c < 5000000;
id estRows task access object operator info
IndexMerge_8 4999999.00 root
Expand Down
16 changes: 8 additions & 8 deletions cmd/explaintest/r/explain_join_stats.result
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ load stats 's/explain_join_stats_lo.json';
explain select count(*) from e, lo where lo.a=e.a and e.b=22336;
id estRows task access object operator info
StreamAgg_13 1.00 root funcs:count(1)->Column#5
└─HashJoin_89 19977.00 root inner join, equal:[eq(test.lo.a, test.e.a)]
└─HashJoin_89 20044.00 root inner join, equal:[eq(test.lo.a, test.e.a)]
├─TableReader_50(Build) 250.00 root data:TableFullScan_49
│ └─TableFullScan_49 250.00 cop[tikv] table:lo keep order:false
└─IndexLookUp_61(Probe) 19977.00 root
├─IndexRangeScan_58(Build) 19977.00 cop[tikv] table:e, index:idx_b(b) range:[22336,22336], keep order:false
└─Selection_60(Probe) 19977.00 cop[tikv] not(isnull(test.e.a))
└─TableRowIDScan_59 19977.00 cop[tikv] table:e keep order:false
└─IndexLookUp_61(Probe) 20044.00 root
├─IndexRangeScan_58(Build) 20044.00 cop[tikv] table:e, index:idx_b(b) range:[22336,22336], keep order:false
└─Selection_60(Probe) 20044.00 cop[tikv] not(isnull(test.e.a))
└─TableRowIDScan_59 20044.00 cop[tikv] table:e keep order:false
explain select /*+ TIDB_INLJ(e) */ count(*) from e, lo where lo.a=e.a and e.b=22336;
id estRows task access object operator info
StreamAgg_12 1.00 root funcs:count(1)->Column#5
└─IndexJoin_56 19977.00 root inner join, inner:IndexLookUp_55, outer key:test.lo.a, inner key:test.e.a
└─IndexJoin_56 20044.00 root inner join, inner:IndexLookUp_55, outer key:test.lo.a, inner key:test.e.a
├─TableReader_40(Build) 250.00 root data:TableFullScan_39
│ └─TableFullScan_39 250.00 cop[tikv] table:lo keep order:false
└─IndexLookUp_55(Probe) 79.91 root
└─IndexLookUp_55(Probe) 80.18 root
├─Selection_53(Build) 4080.00 cop[tikv] not(isnull(test.e.a))
│ └─IndexRangeScan_51 4080.00 cop[tikv] table:e, index:idx_a(a) range: decided by [eq(test.e.a, test.lo.a)], keep order:false
└─Selection_54(Probe) 79.91 cop[tikv] eq(test.e.b, 22336)
└─Selection_54(Probe) 80.18 cop[tikv] eq(test.e.b, 22336)
└─TableRowIDScan_52 4080.00 cop[tikv] table:e keep order:false
2 changes: 1 addition & 1 deletion cmd/explaintest/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ if [ "${TIDB_TEST_STORE_NAME}" = "tikv" ]; then
$tidb_server -P "$port" -status "$status" -config config.toml -store tikv -path "${TIKV_PATH}" > $explain_test_log 2>&1 &
SERVER_PID=$!
else
$tidb_server -P "$port" -status "$status" -config config.toml -store mocktikv -path "" > $explain_test_log 2>&1 &
$tidb_server -P "$port" -status "$status" -config config.toml -store unistore -path "" > $explain_test_log 2>&1 &
SERVER_PID=$!
fi
echo "tidb-server(PID: $SERVER_PID) started"
Expand Down
4 changes: 2 additions & 2 deletions distsql/select_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ func (r *selectResult) fetchResp(ctx context.Context) error {
sc.AppendWarning(dbterror.ClassTiKV.Synthesize(terror.ErrCode(warning.Code), warning.Msg))
}
if r.feedback != nil {
r.feedback.Update(resultSubset.GetStartKey(), r.selectResp.OutputCounts)
logutil.BgLogger().Warn("select resp", zap.Int64s("output cnt", r.selectResp.OutputCounts), zap.Int64s("ndvs", r.selectResp.Ndvs))
r.feedback.Update(resultSubset.GetStartKey(), r.selectResp.OutputCounts, r.selectResp.Ndvs)
}

r.partialCount++

hasStats, ok := resultSubset.(CopRuntimeStats)
Expand Down
Loading