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

[refactor](variant) refactor sub path push down on variant type #36478

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

morrySnow
Copy link
Contributor

@morrySnow morrySnow commented Jun 18, 2024

intro a new rule VARIANT_SUB_PATH_PRUNING to prune variant sub path.

for example, variant slot v in table t has two sub path: 'c1' and 'c2', after this rule, select v['c1'] from t will only scan one sub path 'c1' of v to reduce scan time.

This rule accomplishes all the work using two components. The Collector traverses from the top down, collecting all the element_at functions on the variant types, and recording the required path from the original variant slot to the current element_at. The Replacer traverses from the bottom up, generating the slots for the required sub path on scan, union, and cte consumer. Then, it replaces the element_at with the corresponding slot.

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@morrySnow
Copy link
Contributor Author

run buildall

@morrySnow morrySnow marked this pull request as draft June 18, 2024 10:00
@morrySnow morrySnow force-pushed the refactor_variant_element_at branch from 78d172c to ef7c773 Compare June 19, 2024 02:44
@morrySnow
Copy link
Contributor Author

run buildall

@morrySnow morrySnow force-pushed the refactor_variant_element_at branch 2 times, most recently from 09d4cc3 to e728e47 Compare June 19, 2024 08:01
@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 39934 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit e728e47a37a6eb3c80eb9261cd81faa5568dd2ab, data reload: false

------ Round 1 ----------------------------------
q1	18329	5110	4380	4380
q2	2692	202	206	202
q3	12015	1112	1202	1112
q4	10614	836	816	816
q5	7928	2756	2675	2675
q6	222	141	145	141
q7	1000	635	637	635
q8	9382	2059	2123	2059
q9	8867	6483	6475	6475
q10	9046	3757	3702	3702
q11	453	260	236	236
q12	408	242	234	234
q13	17757	2986	2959	2959
q14	268	221	226	221
q15	523	470	481	470
q16	518	377	371	371
q17	952	654	600	600
q18	8125	7351	7322	7322
q19	6435	1411	1427	1411
q20	660	318	351	318
q21	5060	3259	3925	3259
q22	388	336	345	336
Total cold run time: 121642 ms
Total hot run time: 39934 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4370	4319	4376	4319
q2	360	303	258	258
q3	3014	2780	2732	2732
q4	1855	1572	1583	1572
q5	5250	5277	5306	5277
q6	224	131	134	131
q7	2129	1720	1709	1709
q8	3174	3308	3305	3305
q9	8388	8395	8346	8346
q10	3858	3673	3719	3673
q11	597	488	507	488
q12	747	592	602	592
q13	17652	3011	3001	3001
q14	296	264	258	258
q15	509	477	479	477
q16	458	408	420	408
q17	1770	1487	1454	1454
q18	7663	7710	7361	7361
q19	1728	1585	1615	1585
q20	1983	1816	1778	1778
q21	4813	4730	4832	4730
q22	617	553	539	539
Total cold run time: 71455 ms
Total hot run time: 53993 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 175748 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit e728e47a37a6eb3c80eb9261cd81faa5568dd2ab, data reload: false

query1	927	382	379	379
query2	6460	2351	2338	2338
query3	6651	208	214	208
query4	19503	17168	17117	17117
query5	4164	481	468	468
query6	250	166	179	166
query7	4590	304	292	292
query8	304	299	283	283
query9	8717	2412	2381	2381
query10	603	300	292	292
query11	10656	10228	10212	10212
query12	135	85	85	85
query13	1629	359	359	359
query14	11158	10315	9968	9968
query15	300	191	196	191
query16	8190	268	271	268
query17	2060	536	518	518
query18	2123	273	285	273
query19	333	151	153	151
query20	93	79	79	79
query21	205	132	132	132
query22	4400	4127	3936	3936
query23	33851	33122	33034	33034
query24	10757	2797	2885	2797
query25	603	354	363	354
query26	1217	181	157	157
query27	2343	316	319	316
query28	7190	2005	2012	2005
query29	865	619	597	597
query30	281	151	151	151
query31	926	760	769	760
query32	90	56	56	56
query33	773	275	296	275
query34	974	481	478	478
query35	764	624	646	624
query36	1077	917	945	917
query37	148	70	70	70
query38	2886	2722	2737	2722
query39	847	811	818	811
query40	213	130	130	130
query41	58	55	58	55
query42	127	101	103	101
query43	586	547	535	535
query44	1227	723	752	723
query45	203	171	171	171
query46	1108	724	724	724
query47	1863	1780	1795	1780
query48	366	300	300	300
query49	1036	408	395	395
query50	782	389	390	389
query51	6807	6697	6693	6693
query52	103	92	98	92
query53	360	296	288	288
query54	919	435	444	435
query55	73	80	74	74
query56	272	259	272	259
query57	1138	1048	1078	1048
query58	251	240	243	240
query59	3336	3132	3002	3002
query60	317	301	285	285
query61	90	92	113	92
query62	660	436	439	436
query63	319	286	289	286
query64	8939	2215	1746	1746
query65	3160	3115	3133	3115
query66	821	338	344	338
query67	15343	15053	14983	14983
query68	4626	547	538	538
query69	530	414	397	397
query70	1215	1178	1128	1128
query71	410	276	265	265
query72	7268	5500	5375	5375
query73	758	324	326	324
query74	5949	5593	5496	5496
query75	3559	2677	2691	2677
query76	2762	962	946	946
query77	502	296	294	294
query78	10308	9794	9742	9742
query79	1925	520	517	517
query80	905	468	455	455
query81	590	219	227	219
query82	710	100	103	100
query83	255	164	163	163
query84	245	85	84	84
query85	1244	303	330	303
query86	455	302	291	291
query87	3260	3078	3111	3078
query88	3270	2345	2358	2345
query89	479	384	381	381
query90	1772	188	193	188
query91	123	98	97	97
query92	66	51	48	48
query93	2160	519	499	499
query94	1239	189	188	188
query95	404	313	317	313
query96	595	280	266	266
query97	3254	3056	3072	3056
query98	217	203	191	191
query99	1327	849	851	849
Total cold run time: 271902 ms
Total hot run time: 175748 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 31.2 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit e728e47a37a6eb3c80eb9261cd81faa5568dd2ab, data reload: false

query1	0.04	0.03	0.03
query2	0.08	0.04	0.04
query3	0.23	0.05	0.04
query4	1.68	0.07	0.06
query5	0.49	0.48	0.48
query6	1.12	0.73	0.72
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.54	0.49	0.48
query10	0.54	0.54	0.53
query11	0.14	0.11	0.12
query12	0.15	0.12	0.12
query13	0.60	0.59	0.60
query14	0.76	0.79	0.80
query15	0.83	0.81	0.80
query16	0.37	0.36	0.36
query17	1.02	1.02	1.00
query18	0.24	0.24	0.25
query19	1.75	1.71	1.71
query20	0.02	0.01	0.01
query21	15.43	0.64	0.64
query22	4.34	6.52	2.50
query23	18.31	1.32	1.35
query24	2.13	0.23	0.21
query25	0.15	0.08	0.07
query26	0.26	0.17	0.18
query27	0.07	0.08	0.08
query28	13.23	1.01	1.00
query29	12.58	3.31	3.30
query30	0.27	0.06	0.06
query31	2.85	0.39	0.38
query32	3.30	0.48	0.47
query33	2.89	2.91	2.92
query34	17.04	4.47	4.43
query35	4.61	4.48	4.52
query36	0.65	0.46	0.48
query37	0.17	0.14	0.15
query38	0.15	0.14	0.14
query39	0.05	0.03	0.03
query40	0.17	0.16	0.13
query41	0.10	0.05	0.04
query42	0.05	0.04	0.04
query43	0.04	0.03	0.03
Total cold run time: 109.51 s
Total hot run time: 31.2 s

@morrySnow morrySnow force-pushed the refactor_variant_element_at branch 2 times, most recently from 7b2546a to cf24bb2 Compare June 19, 2024 12:44
@morrySnow
Copy link
Contributor Author

run buildall

@morrySnow morrySnow force-pushed the refactor_variant_element_at branch 2 times, most recently from 7e0e2de to d5617fe Compare June 19, 2024 13:02
@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 40076 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit d5617fea85afb3814bdd3d1ca452404946723230, data reload: false

------ Round 1 ----------------------------------
q1	17942	4561	4427	4427
q2	2650	201	199	199
q3	11590	1121	1150	1121
q4	10380	886	797	797
q5	7489	2706	2663	2663
q6	230	143	141	141
q7	969	640	615	615
q8	9296	2076	2094	2076
q9	8797	6489	6447	6447
q10	8982	3713	3718	3713
q11	483	243	239	239
q12	431	233	242	233
q13	17762	2980	3019	2980
q14	264	228	218	218
q15	521	467	483	467
q16	505	392	378	378
q17	948	672	699	672
q18	8116	7359	7400	7359
q19	2167	1493	1413	1413
q20	653	308	325	308
q21	4883	3274	3902	3274
q22	399	338	336	336
Total cold run time: 115457 ms
Total hot run time: 40076 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4431	4297	4199	4199
q2	375	278	267	267
q3	2947	2746	2708	2708
q4	1920	1646	1654	1646
q5	5261	5274	5324	5274
q6	226	130	132	130
q7	2118	1743	1725	1725
q8	3182	3365	3319	3319
q9	8328	8338	8391	8338
q10	3867	3699	3584	3584
q11	578	488	485	485
q12	772	576	615	576
q13	17597	3036	3024	3024
q14	289	251	268	251
q15	522	477	483	477
q16	478	410	408	408
q17	1778	1499	1479	1479
q18	7704	7501	7601	7501
q19	6575	1718	1696	1696
q20	2017	1773	1759	1759
q21	4868	4754	4742	4742
q22	623	531	542	531
Total cold run time: 76456 ms
Total hot run time: 54119 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 173463 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit d5617fea85afb3814bdd3d1ca452404946723230, data reload: false

query1	944	417	385	385
query2	6479	2348	2277	2277
query3	6676	213	214	213
query4	19668	17302	17309	17302
query5	4144	470	452	452
query6	255	158	161	158
query7	4594	298	288	288
query8	335	296	293	293
query9	8394	2431	2394	2394
query10	599	293	289	289
query11	10481	10034	9985	9985
query12	149	91	85	85
query13	1658	366	372	366
query14	10063	7595	7543	7543
query15	230	190	185	185
query16	7797	272	265	265
query17	1695	565	551	551
query18	1962	276	270	270
query19	198	160	160	160
query20	92	85	84	84
query21	217	136	135	135
query22	4334	4106	4099	4099
query23	33752	33088	33021	33021
query24	11985	2895	2829	2829
query25	662	359	363	359
query26	1790	151	151	151
query27	2999	321	317	317
query28	7574	2067	2049	2049
query29	1085	628	612	612
query30	271	159	152	152
query31	948	725	728	725
query32	91	54	56	54
query33	773	303	287	287
query34	929	470	467	467
query35	749	656	609	609
query36	1104	931	945	931
query37	178	71	71	71
query38	2902	2753	2752	2752
query39	844	806	792	792
query40	283	126	130	126
query41	53	55	52	52
query42	117	97	101	97
query43	564	556	553	553
query44	1195	727	733	727
query45	212	163	172	163
query46	1081	719	741	719
query47	1877	1738	1782	1738
query48	367	299	301	299
query49	1180	402	397	397
query50	769	382	398	382
query51	6728	6729	6570	6570
query52	106	90	96	90
query53	359	302	297	297
query54	1045	441	432	432
query55	75	75	74	74
query56	315	267	260	260
query57	1146	1061	1068	1061
query58	243	237	248	237
query59	3406	3063	3011	3011
query60	289	290	270	270
query61	96	94	90	90
query62	676	447	450	447
query63	321	298	294	294
query64	9921	2246	1722	1722
query65	3177	3110	3108	3108
query66	1376	336	336	336
query67	15449	14979	14855	14855
query68	4586	537	527	527
query69	458	300	312	300
query70	1142	1134	1144	1134
query71	388	283	265	265
query72	7147	5646	5881	5646
query73	748	324	324	324
query74	6007	5529	5489	5489
query75	3377	2668	2710	2668
query76	2515	918	923	918
query77	431	306	297	297
query78	10243	9908	9864	9864
query79	2485	521	500	500
query80	1008	453	448	448
query81	577	223	242	223
query82	671	108	109	108
query83	234	176	171	171
query84	235	84	84	84
query85	1867	279	273	273
query86	497	335	318	318
query87	3277	3136	3094	3094
query88	3805	2353	2369	2353
query89	472	394	396	394
query90	1834	195	199	195
query91	145	115	116	115
query92	65	51	53	51
query93	2265	518	495	495
query94	1264	204	197	197
query95	415	325	335	325
query96	606	275	276	275
query97	3222	3056	3019	3019
query98	213	207	199	199
query99	1142	830	856	830
Total cold run time: 275367 ms
Total hot run time: 173463 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.93 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit d5617fea85afb3814bdd3d1ca452404946723230, data reload: false

query1	0.04	0.04	0.03
query2	0.08	0.04	0.05
query3	0.23	0.06	0.06
query4	1.66	0.10	0.08
query5	0.50	0.49	0.49
query6	1.12	0.73	0.72
query7	0.02	0.02	0.01
query8	0.05	0.04	0.05
query9	0.56	0.50	0.49
query10	0.54	0.56	0.56
query11	0.14	0.11	0.11
query12	0.14	0.12	0.12
query13	0.60	0.59	0.60
query14	0.75	0.77	0.78
query15	0.83	0.81	0.82
query16	0.37	0.37	0.38
query17	1.04	1.04	1.03
query18	0.20	0.23	0.26
query19	1.79	1.69	1.84
query20	0.02	0.01	0.01
query21	15.44	0.65	0.64
query22	3.83	7.02	2.27
query23	18.29	1.47	1.26
query24	2.13	0.22	0.20
query25	0.16	0.08	0.09
query26	0.26	0.18	0.17
query27	0.08	0.08	0.08
query28	13.24	1.01	0.98
query29	12.63	3.31	3.24
query30	0.27	0.06	0.06
query31	2.86	0.39	0.39
query32	3.26	0.47	0.47
query33	2.92	2.90	2.93
query34	17.13	4.47	4.41
query35	4.51	4.46	4.48
query36	0.64	0.48	0.49
query37	0.18	0.15	0.15
query38	0.14	0.14	0.15
query39	0.04	0.03	0.04
query40	0.18	0.14	0.13
query41	0.09	0.05	0.05
query42	0.06	0.05	0.05
query43	0.05	0.04	0.04
Total cold run time: 109.07 s
Total hot run time: 30.93 s

@morrySnow morrySnow force-pushed the refactor_variant_element_at branch from d5617fe to cc9cdaf Compare June 20, 2024 04:39
@morrySnow
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TPC-H: Total hot run time: 40522 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit cc9cdafcbf2152d298b51c6c9915d8ed24f1a392, data reload: false

------ Round 1 ----------------------------------
q1	6410	4430	4357	4357
q2	610	198	217	198
q3	1409	1134	1139	1134
q4	1041	844	773	773
q5	2808	2706	2694	2694
q6	224	138	137	137
q7	978	626	614	614
q8	2035	2255	2234	2234
q9	6702	6606	6624	6606
q10	3888	3786	3744	3744
q11	387	249	243	243
q12	414	241	230	230
q13	17249	3009	3011	3009
q14	272	221	223	221
q15	531	483	470	470
q16	499	393	378	378
q17	962	666	818	666
q18	8011	7427	7471	7427
q19	1633	1481	1506	1481
q20	541	313	361	313
q21	4993	3879	3254	3254
q22	397	341	339	339
Total cold run time: 61994 ms
Total hot run time: 40522 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4323	4251	4302	4251
q2	368	282	269	269
q3	2986	2802	2739	2739
q4	1912	1659	1658	1658
q5	5279	5288	5325	5288
q6	223	128	130	128
q7	2056	1698	1770	1698
q8	3217	3364	3363	3363
q9	8366	8410	8379	8379
q10	3898	3671	3726	3671
q11	596	493	485	485
q12	760	637	617	617
q13	16418	2991	3003	2991
q14	300	257	281	257
q15	527	488	472	472
q16	500	415	412	412
q17	1806	1515	1469	1469
q18	7520	7507	7414	7414
q19	1675	1641	1678	1641
q20	1990	1793	1778	1778
q21	4852	4618	4862	4618
q22	600	555	578	555
Total cold run time: 70172 ms
Total hot run time: 54153 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 173610 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit cc9cdafcbf2152d298b51c6c9915d8ed24f1a392, data reload: false

query1	919	385	381	381
query2	6464	2380	2387	2380
query3	6658	210	215	210
query4	19021	17409	17195	17195
query5	4179	472	468	468
query6	254	162	160	160
query7	4585	292	293	292
query8	333	309	294	294
query9	8420	2437	2421	2421
query10	628	306	287	287
query11	10430	10135	10094	10094
query12	131	85	86	85
query13	1641	355	357	355
query14	10251	7610	7521	7521
query15	271	188	181	181
query16	8033	264	261	261
query17	1928	541	538	538
query18	2053	279	272	272
query19	203	165	160	160
query20	94	85	85	85
query21	213	132	129	129
query22	4292	4099	3966	3966
query23	33775	33616	33151	33151
query24	10781	2793	2805	2793
query25	562	362	360	360
query26	696	152	149	149
query27	2237	303	318	303
query28	5871	2079	2063	2063
query29	844	620	613	613
query30	288	166	152	152
query31	923	741	773	741
query32	96	53	57	53
query33	675	291	275	275
query34	858	477	461	461
query35	737	614	650	614
query36	1105	910	911	910
query37	134	74	77	74
query38	2896	2784	2800	2784
query39	828	792	796	792
query40	214	134	134	134
query41	59	49	54	49
query42	128	103	99	99
query43	586	539	540	539
query44	1068	727	734	727
query45	200	175	174	174
query46	1089	719	709	709
query47	1841	1777	1793	1777
query48	369	297	305	297
query49	1059	435	425	425
query50	777	386	373	373
query51	6787	6608	6625	6608
query52	109	95	94	94
query53	368	290	288	288
query54	896	449	452	449
query55	75	75	74	74
query56	347	255	263	255
query57	1103	1041	1040	1040
query58	243	239	236	236
query59	3655	3448	3230	3230
query60	320	273	274	273
query61	121	95	92	92
query62	643	441	432	432
query63	312	293	286	286
query64	8606	2231	1735	1735
query65	3146	3132	3119	3119
query66	812	338	328	328
query67	15504	14876	14927	14876
query68	4557	546	534	534
query69	456	308	306	306
query70	1164	1152	1111	1111
query71	377	271	289	271
query72	7056	5749	5697	5697
query73	748	320	317	317
query74	5951	5500	5552	5500
query75	3335	2659	2659	2659
query76	2429	932	937	932
query77	451	297	292	292
query78	10448	9874	9735	9735
query79	2716	502	501	501
query80	1630	461	458	458
query81	573	213	219	213
query82	827	103	103	103
query83	281	173	169	169
query84	267	88	90	88
query85	1350	292	265	265
query86	449	335	293	293
query87	3275	3128	3109	3109
query88	4395	2333	2331	2331
query89	477	372	394	372
query90	1778	201	188	188
query91	127	100	97	97
query92	61	48	51	48
query93	1847	508	489	489
query94	1130	187	188	187
query95	397	300	315	300
query96	589	274	263	263
query97	3188	3068	3016	3016
query98	217	210	193	193
query99	1153	832	835	832
Total cold run time: 268443 ms
Total hot run time: 173610 ms

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.48% (9007/24692)
Line Coverage: 28.02% (73847/263542)
Region Coverage: 27.51% (38358/139411)
Branch Coverage: 24.21% (19552/80760)
Coverage Report: http://coverage.selectdb-in.cc/coverage/cc9cdafcbf2152d298b51c6c9915d8ed24f1a392_cc9cdafcbf2152d298b51c6c9915d8ed24f1a392/report/index.html

@doris-robot
Copy link

ClickBench: Total hot run time: 30.72 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit cc9cdafcbf2152d298b51c6c9915d8ed24f1a392, data reload: false

query1	0.04	0.04	0.03
query2	0.08	0.03	0.04
query3	0.22	0.05	0.06
query4	1.68	0.09	0.09
query5	0.49	0.49	0.47
query6	1.12	0.73	0.73
query7	0.02	0.01	0.01
query8	0.06	0.05	0.05
query9	0.55	0.50	0.49
query10	0.56	0.54	0.55
query11	0.16	0.12	0.12
query12	0.14	0.12	0.12
query13	0.59	0.58	0.60
query14	0.76	0.78	0.78
query15	0.83	0.81	0.82
query16	0.36	0.37	0.37
query17	1.03	1.04	1.04
query18	0.22	0.23	0.26
query19	1.80	1.72	1.71
query20	0.01	0.01	0.01
query21	15.40	0.66	0.65
query22	4.41	7.19	2.03
query23	18.34	1.35	1.34
query24	2.17	0.21	0.21
query25	0.16	0.09	0.08
query26	0.28	0.17	0.17
query27	0.08	0.07	0.07
query28	13.26	1.00	1.00
query29	12.67	3.23	3.19
query30	0.26	0.06	0.06
query31	2.87	0.40	0.39
query32	3.28	0.48	0.48
query33	2.90	2.83	2.93
query34	17.23	4.41	4.40
query35	4.46	4.50	4.52
query36	0.66	0.45	0.46
query37	0.20	0.15	0.15
query38	0.15	0.15	0.15
query39	0.05	0.04	0.04
query40	0.17	0.14	0.15
query41	0.10	0.05	0.05
query42	0.05	0.04	0.05
query43	0.05	0.04	0.04
Total cold run time: 109.92 s
Total hot run time: 30.72 s

@morrySnow morrySnow force-pushed the refactor_variant_element_at branch from cc9cdaf to e2479a6 Compare June 20, 2024 07:19
@morrySnow
Copy link
Contributor Author

run buildall

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jun 20, 2024
Copy link
Contributor

PR approved by at least one committer and no changes requested.

Copy link
Contributor

PR approved by anyone and no changes requested.

intro a new rule VARIANT_SUB_PATH_PRUNING to prune variant sub path
@morrySnow
Copy link
Contributor Author

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Jun 20, 2024
@doris-robot
Copy link

TPC-H: Total hot run time: 39720 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 81253775e581b7978a9378a3c1b7a5b493cf4d93, data reload: false

------ Round 1 ----------------------------------
q1	17617	5017	4274	4274
q2	2033	189	191	189
q3	10581	1142	1078	1078
q4	10333	820	718	718
q5	7468	2631	2607	2607
q6	223	137	137	137
q7	949	613	602	602
q8	9220	2115	2073	2073
q9	9504	6519	6472	6472
q10	8982	3739	3712	3712
q11	473	252	235	235
q12	465	235	225	225
q13	18990	2981	2999	2981
q14	263	207	220	207
q15	526	470	473	470
q16	517	389	384	384
q17	987	699	751	699
q18	8032	7429	7344	7344
q19	1682	1495	1513	1495
q20	659	311	347	311
q21	5035	3168	3850	3168
q22	390	339	343	339
Total cold run time: 114929 ms
Total hot run time: 39720 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4312	4251	4257	4251
q2	367	269	253	253
q3	2940	2713	2746	2713
q4	1873	1591	1622	1591
q5	5287	5280	5279	5279
q6	217	126	127	126
q7	2117	1776	1695	1695
q8	3179	3383	3324	3324
q9	8403	8341	8343	8341
q10	3906	3659	3688	3659
q11	605	501	478	478
q12	766	594	604	594
q13	16644	2965	3010	2965
q14	288	267	249	249
q15	519	480	483	480
q16	464	407	410	407
q17	1800	1474	1472	1472
q18	7520	7414	7396	7396
q19	1649	1604	1509	1509
q20	1981	1797	1747	1747
q21	4780	4806	4569	4569
q22	608	518	580	518
Total cold run time: 70225 ms
Total hot run time: 53616 ms

@morrySnow
Copy link
Contributor Author

run performance

Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jun 21, 2024
@doris-robot
Copy link

TPC-H: Total hot run time: 40108 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 81253775e581b7978a9378a3c1b7a5b493cf4d93, data reload: false

------ Round 1 ----------------------------------
q1	17603	4426	4234	4234
q2	2029	184	203	184
q3	10460	1149	1091	1091
q4	10205	777	734	734
q5	7458	2667	2595	2595
q6	221	134	134	134
q7	952	597	606	597
q8	9224	2088	2065	2065
q9	8624	6521	6512	6512
q10	8923	3718	3728	3718
q11	447	231	234	231
q12	484	220	221	220
q13	17777	2935	2987	2935
q14	278	211	222	211
q15	529	476	479	476
q16	527	376	372	372
q17	970	682	616	616
q18	8025	7339	7296	7296
q19	6521	1457	1467	1457
q20	637	320	318	318
q21	4858	3774	3962	3774
q22	407	338	351	338
Total cold run time: 117159 ms
Total hot run time: 40108 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4394	4251	4234	4234
q2	378	264	312	264
q3	2935	2901	2870	2870
q4	1989	1713	1731	1713
q5	5555	5487	5441	5441
q6	218	130	129	129
q7	2199	1851	1846	1846
q8	3277	3361	3419	3361
q9	8638	8710	8777	8710
q10	4060	3820	3747	3747
q11	596	497	496	496
q12	808	634	632	632
q13	16792	3170	3189	3170
q14	304	264	287	264
q15	534	463	506	463
q16	513	427	441	427
q17	1929	1525	1494	1494
q18	8095	7836	7920	7836
q19	1836	1510	1574	1510
q20	3053	1899	1846	1846
q21	5007	5006	4793	4793
q22	580	570	527	527
Total cold run time: 73690 ms
Total hot run time: 55773 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 172351 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 81253775e581b7978a9378a3c1b7a5b493cf4d93, data reload: false

query1	941	374	369	369
query2	6443	2418	2429	2418
query3	6638	211	211	211
query4	21982	17270	17343	17270
query5	3552	482	458	458
query6	244	169	159	159
query7	4589	297	292	292
query8	339	303	290	290
query9	8663	2427	2423	2423
query10	583	289	272	272
query11	10603	9850	9982	9850
query12	126	81	88	81
query13	1648	355	357	355
query14	10041	6861	7462	6861
query15	235	189	196	189
query16	7746	267	256	256
query17	1661	516	517	516
query18	1942	297	277	277
query19	192	150	152	150
query20	93	88	81	81
query21	213	131	126	126
query22	4279	4126	3980	3980
query23	33627	33393	33727	33393
query24	10983	2806	2926	2806
query25	592	381	363	363
query26	718	155	154	154
query27	2306	330	323	323
query28	6045	2161	2127	2127
query29	875	647	613	613
query30	259	155	155	155
query31	995	771	768	768
query32	101	54	54	54
query33	727	325	268	268
query34	965	479	463	463
query35	767	626	636	626
query36	1160	945	994	945
query37	151	74	72	72
query38	2900	2800	2878	2800
query39	892	849	833	833
query40	212	131	131	131
query41	52	55	54	54
query42	111	109	111	109
query43	623	581	575	575
query44	1136	728	743	728
query45	207	162	164	162
query46	1064	705	708	705
query47	1832	1775	1755	1755
query48	380	305	302	302
query49	852	413	421	413
query50	761	383	392	383
query51	6830	6769	6672	6672
query52	101	96	93	93
query53	362	292	282	282
query54	908	438	448	438
query55	76	73	75	73
query56	301	275	302	275
query57	1139	1042	1037	1037
query58	251	245	256	245
query59	3529	3285	3195	3195
query60	311	294	284	284
query61	115	114	113	113
query62	606	446	452	446
query63	327	295	294	294
query64	8583	2258	1710	1710
query65	3145	3088	3082	3082
query66	737	323	325	323
query67	15259	15027	14800	14800
query68	4612	520	524	520
query69	654	412	382	382
query70	1180	1156	1168	1156
query71	414	277	274	274
query72	8239	5824	4779	4779
query73	742	314	317	314
query74	5870	5490	5494	5490
query75	3634	2640	2628	2628
query76	2573	928	919	919
query77	664	291	298	291
query78	10185	9830	9800	9800
query79	3703	505	511	505
query80	1025	464	455	455
query81	543	224	224	224
query82	914	104	99	99
query83	311	170	185	170
query84	265	86	85	85
query85	1299	277	264	264
query86	450	297	330	297
query87	3252	3078	3066	3066
query88	4040	2337	2325	2325
query89	488	390	370	370
query90	1888	187	187	187
query91	129	99	98	98
query92	60	51	49	49
query93	4721	494	490	490
query94	1215	189	249	189
query95	405	305	309	305
query96	596	261	259	259
query97	3249	3023	3050	3023
query98	221	199	193	193
query99	1206	819	848	819
Total cold run time: 275373 ms
Total hot run time: 172351 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.49 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 81253775e581b7978a9378a3c1b7a5b493cf4d93, data reload: false

query1	0.04	0.04	0.04
query2	0.08	0.04	0.04
query3	0.23	0.05	0.05
query4	1.65	0.07	0.08
query5	0.49	0.48	0.48
query6	1.12	0.73	0.72
query7	0.03	0.02	0.02
query8	0.05	0.04	0.04
query9	0.56	0.51	0.49
query10	0.53	0.54	0.52
query11	0.15	0.11	0.11
query12	0.15	0.13	0.13
query13	0.60	0.58	0.60
query14	0.76	0.79	0.78
query15	0.83	0.80	0.82
query16	0.36	0.37	0.37
query17	0.99	1.05	1.05
query18	0.24	0.23	0.27
query19	1.81	1.83	1.76
query20	0.02	0.01	0.01
query21	15.41	0.66	0.66
query22	3.90	8.19	1.88
query23	18.31	1.41	1.26
query24	2.13	0.21	0.23
query25	0.15	0.09	0.09
query26	0.28	0.18	0.17
query27	0.08	0.08	0.08
query28	13.29	1.03	0.99
query29	12.71	3.24	3.22
query30	0.26	0.07	0.06
query31	2.85	0.38	0.38
query32	3.27	0.47	0.46
query33	2.91	2.84	2.94
query34	17.18	4.40	4.38
query35	4.53	4.48	4.45
query36	0.65	0.47	0.46
query37	0.19	0.16	0.16
query38	0.15	0.16	0.15
query39	0.04	0.04	0.04
query40	0.17	0.13	0.14
query41	0.10	0.05	0.05
query42	0.06	0.05	0.04
query43	0.04	0.04	0.04
Total cold run time: 109.35 s
Total hot run time: 30.49 s

@morrySnow morrySnow merged commit 86fc14e into apache:master Jun 21, 2024
27 of 30 checks passed
@morrySnow morrySnow deleted the refactor_variant_element_at branch June 21, 2024 03:31
iszhangpch pushed a commit to iszhangpch/doris-p that referenced this pull request Jun 21, 2024
…he#36478)

intro a new rule VARIANT_SUB_PATH_PRUNING to prune variant sub path.

for example, variant slot v in table t has two sub path: 'c1' and 'c2',
after this rule, select v['c1'] from t will only scan one sub path 'c1'
of v to reduce scan time.

This rule accomplishes all the work using two components. The Collector
traverses from the top down, collecting all the element_at functions on
the variant types, and recording the required path from the original
variant slot to the current element_at. The Replacer traverses from the
bottom up, generating the slots for the required sub path on scan,
union, and cte consumer. Then, it replaces the element_at with the
corresponding slot.
dataroaring pushed a commit that referenced this pull request Jun 21, 2024
intro a new rule VARIANT_SUB_PATH_PRUNING to prune variant sub path.

for example, variant slot v in table t has two sub path: 'c1' and 'c2',
after this rule, select v['c1'] from t will only scan one sub path 'c1'
of v to reduce scan time.

This rule accomplishes all the work using two components. The Collector
traverses from the top down, collecting all the element_at functions on
the variant types, and recording the required path from the original
variant slot to the current element_at. The Replacer traverses from the
bottom up, generating the slots for the required sub path on scan,
union, and cte consumer. Then, it replaces the element_at with the
corresponding slot.
morrySnow added a commit to morrySnow/incubator-doris that referenced this pull request Jun 27, 2024
…he#36478)

pick from master apache#36478

intro a new rule VARIANT_SUB_PATH_PRUNING to prune variant sub path.

for example, variant slot v in table t has two sub path: 'c1' and 'c2',
after this rule, select v['c1'] from t will only scan one sub path 'c1'
of v to reduce scan time.

This rule accomplishes all the work using two components. The Collector
traverses from the top down, collecting all the element_at functions on
the variant types, and recording the required path from the original
variant slot to the current element_at. The Replacer traverses from the
bottom up, generating the slots for the required sub path on scan,
union, and cte consumer. Then, it replaces the element_at with the
corresponding slot.
morrySnow added a commit that referenced this pull request Jun 27, 2024
…) (#36923)

pick from master #36478

intro a new rule VARIANT_SUB_PATH_PRUNING to prune variant sub path.

for example, variant slot v in table t has two sub path: 'c1' and 'c2',
after this rule, select v['c1'] from t will only scan one sub path 'c1'
of v to reduce scan time.

This rule accomplishes all the work using two components. The Collector
traverses from the top down, collecting all the element_at functions on
the variant types, and recording the required path from the original
variant slot to the current element_at. The Replacer traverses from the
bottom up, generating the slots for the required sub path on scan,
union, and cte consumer. Then, it replaces the element_at with the
corresponding slot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. dev/2.1.5-merged dev/3.0.0-merged reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants