Skip to content

Conversation

@feiniaofeiafei
Copy link
Contributor

rewrite func(para) over (partition by unique_keys)

  1. func() is count(non-null) or rank/dense_rank/row_number -> 1
  2. func(para) is min/max/sum/avg/first_value/last_value -> para
    e.g
    select max(c1) over(partition by pk) from t1;
    -> select c1 from t1;

@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.

@feiniaofeiafei
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17634	4313	4209	4209
q2	2015	189	187	187
q3	10449	1182	1130	1130
q4	10189	734	813	734
q5	7513	2702	2646	2646
q6	212	129	133	129
q7	994	602	580	580
q8	9206	2053	2029	2029
q9	7976	6569	6541	6541
q10	8491	3511	3514	3511
q11	459	244	230	230
q12	469	221	214	214
q13	19011	2922	2922	2922
q14	269	231	237	231
q15	525	474	476	474
q16	540	405	380	380
q17	957	644	674	644
q18	7277	6743	6624	6624
q19	5464	1530	1495	1495
q20	695	315	317	315
q21	3479	2808	2702	2702
q22	364	301	305	301
Total cold run time: 114188 ms
Total hot run time: 38228 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4304	4221	4208	4208
q2	365	251	253	251
q3	2928	2703	2761	2703
q4	1876	1556	1592	1556
q5	5346	5317	5303	5303
q6	206	124	124	124
q7	2238	1877	1896	1877
q8	3197	3317	3307	3307
q9	8606	8602	8617	8602
q10	4025	3900	4013	3900
q11	636	481	478	478
q12	789	615	619	615
q13	16390	3185	3212	3185
q14	329	268	286	268
q15	507	477	476	476
q16	505	445	447	445
q17	1844	1562	1519	1519
q18	7978	7838	7750	7750
q19	1713	1605	1530	1530
q20	1969	1807	1894	1807
q21	5087	4897	5007	4897
q22	576	465	472	465
Total cold run time: 71414 ms
Total hot run time: 55266 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 184160 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 e2832b9840d9e9a2a8af3babdd30e6acc26d04c3, data reload: false

query1	898	1111	343	343
query2	7654	2611	2370	2370
query3	6651	207	200	200
query4	36869	21536	21322	21322
query5	4138	402	398	398
query6	225	175	180	175
query7	4048	295	294	294
query8	228	175	173	173
query9	5789	2322	2314	2314
query10	364	243	249	243
query11	14527	14219	14146	14146
query12	144	95	87	87
query13	1011	360	368	360
query14	9970	7019	7156	7019
query15	204	175	179	175
query16	7027	279	261	261
query17	1521	591	558	558
query18	1380	297	278	278
query19	196	156	154	154
query20	98	88	90	88
query21	197	126	127	126
query22	5075	4845	4848	4845
query23	33518	32945	33003	32945
query24	5688	3025	3004	3004
query25	500	423	385	385
query26	605	168	165	165
query27	2342	364	378	364
query28	4119	2102	2071	2071
query29	875	621	625	621
query30	245	180	177	177
query31	957	735	732	732
query32	58	55	52	52
query33	482	238	241	238
query34	901	492	503	492
query35	793	715	742	715
query36	1044	943	935	935
query37	110	73	79	73
query38	3704	3636	3548	3548
query39	1672	1570	1599	1570
query40	179	130	126	126
query41	47	41	41	41
query42	115	97	103	97
query43	586	578	552	552
query44	1219	728	763	728
query45	289	273	280	273
query46	1066	721	742	721
query47	2039	1965	1920	1920
query48	377	298	304	298
query49	664	372	373	372
query50	768	393	385	385
query51	6786	6856	6715	6715
query52	103	91	90	90
query53	358	283	288	283
query54	272	222	231	222
query55	76	74	81	74
query56	250	231	233	231
query57	1271	1217	1203	1203
query58	225	235	236	235
query59	3661	3033	3222	3033
query60	253	228	240	228
query61	90	92	89	89
query62	540	441	430	430
query63	298	280	274	274
query64	3919	4033	3913	3913
query65	3079	3037	3037	3037
query66	746	316	305	305
query67	15463	15280	15068	15068
query68	7541	547	551	547
query69	567	325	301	301
query70	1260	1144	1182	1144
query71	444	270	277	270
query72	6529	2771	2437	2437
query73	838	319	320	319
query74	7026	6339	6408	6339
query75	3089	2299	2295	2295
query76	4167	1114	1120	1114
query77	642	246	245	245
query78	11002	10071	10014	10014
query79	6148	525	523	523
query80	1870	425	450	425
query81	506	232	246	232
query82	1607	91	94	91
query83	351	165	167	165
query84	265	83	81	81
query85	918	268	260	260
query86	457	306	301	301
query87	3751	3486	3537	3486
query88	5480	2439	2294	2294
query89	480	362	369	362
query90	2070	180	181	180
query91	123	99	97	97
query92	56	47	48	47
query93	5723	505	512	505
query94	968	179	179	179
query95	1095	1101	1093	1093
query96	616	260	265	260
query97	2665	2500	2502	2500
query98	225	230	213	213
query99	1155	885	882	882
Total cold run time: 290200 ms
Total hot run time: 184160 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.08	0.04	0.04
query3	0.23	0.05	0.06
query4	1.68	0.07	0.08
query5	0.49	0.50	0.48
query6	1.48	0.66	0.65
query7	0.02	0.01	0.01
query8	0.05	0.05	0.04
query9	0.54	0.48	0.50
query10	0.55	0.56	0.55
query11	0.15	0.11	0.11
query12	0.15	0.12	0.12
query13	0.61	0.59	0.59
query14	0.75	0.77	0.81
query15	0.82	0.81	0.80
query16	0.35	0.36	0.36
query17	1.02	0.94	1.00
query18	0.22	0.23	0.23
query19	1.79	1.71	1.66
query20	0.02	0.01	0.01
query21	15.40	0.66	0.66
query22	4.72	6.82	2.02
query23	18.30	1.40	1.23
query24	1.70	0.34	0.21
query25	0.13	0.08	0.09
query26	0.27	0.16	0.17
query27	0.08	0.08	0.08
query28	13.29	1.00	0.98
query29	12.59	3.32	3.28
query30	0.26	0.07	0.06
query31	2.86	0.40	0.37
query32	3.33	0.45	0.46
query33	2.86	2.82	2.80
query34	17.01	4.40	4.40
query35	4.52	4.42	4.47
query36	0.64	0.46	0.46
query37	0.18	0.15	0.16
query38	0.15	0.15	0.15
query39	0.04	0.04	0.04
query40	0.18	0.16	0.14
query41	0.09	0.06	0.05
query42	0.05	0.05	0.05
query43	0.05	0.04	0.03
Total cold run time: 109.74 s
Total hot run time: 30.26 s

@doris-robot
Copy link

Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Load test result on commit e2832b9840d9e9a2a8af3babdd30e6acc26d04c3 with default session variables
Stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
Stream load orc:          58 seconds loaded 1101869774 Bytes, about 18 MB/s
Stream load parquet:      33 seconds loaded 861443392 Bytes, about 24 MB/s
Insert into select:       13.6 seconds inserted 10000000 Rows, about 735K ops/s

@feiniaofeiafei
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17604	4312	4254	4254
q2	2022	209	182	182
q3	10442	1187	1160	1160
q4	10200	787	764	764
q5	7528	2701	2617	2617
q6	216	131	130	130
q7	1017	608	596	596
q8	9218	2068	2060	2060
q9	7998	6582	6507	6507
q10	8590	3560	3542	3542
q11	458	240	242	240
q12	497	227	217	217
q13	17983	2985	2963	2963
q14	282	239	243	239
q15	522	472	485	472
q16	512	398	378	378
q17	1017	715	606	606
q18	7328	6844	6774	6774
q19	6204	1539	1487	1487
q20	694	336	321	321
q21	3611	2774	2839	2774
q22	359	301	302	301
Total cold run time: 114302 ms
Total hot run time: 38584 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4354	4250	4189	4189
q2	370	262	263	262
q3	2999	2793	2797	2793
q4	1907	1659	1541	1541
q5	5356	5345	5350	5345
q6	207	122	123	122
q7	2247	1876	1857	1857
q8	3201	3349	3346	3346
q9	8671	8674	8831	8674
q10	4167	4015	4074	4015
q11	610	495	506	495
q12	797	617	653	617
q13	16525	3188	3179	3179
q14	322	276	283	276
q15	506	501	488	488
q16	486	434	457	434
q17	1803	1552	1499	1499
q18	8018	8039	7850	7850
q19	1696	1545	1507	1507
q20	2033	1872	1873	1872
q21	5084	5005	5042	5005
q22	563	475	470	470
Total cold run time: 71922 ms
Total hot run time: 55836 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 183515 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 549420dde3854b83e974ad71cc0c6d24b5d18105, data reload: false

query1	875	1118	1116	1116
query2	7479	2597	2442	2442
query3	6662	207	214	207
query4	36703	21521	21327	21327
query5	4147	395	399	395
query6	228	183	194	183
query7	4048	287	280	280
query8	212	170	171	170
query9	5800	2273	2261	2261
query10	373	234	240	234
query11	14654	14297	14358	14297
query12	146	92	92	92
query13	998	357	351	351
query14	8692	6887	6813	6813
query15	210	173	178	173
query16	7214	266	254	254
query17	1670	591	567	567
query18	1501	284	280	280
query19	204	155	157	155
query20	98	86	96	86
query21	197	131	126	126
query22	4992	4856	4777	4777
query23	33520	33156	33252	33156
query24	7778	2990	3097	2990
query25	530	409	390	390
query26	862	154	149	149
query27	3020	360	363	360
query28	6456	2080	2077	2077
query29	856	650	616	616
query30	299	171	165	165
query31	924	740	751	740
query32	57	66	54	54
query33	496	245	236	236
query34	885	483	498	483
query35	799	687	718	687
query36	1043	925	937	925
query37	110	77	74	74
query38	3392	3268	3311	3268
query39	1080	1022	1054	1022
query40	177	128	129	128
query41	45	43	43	43
query42	101	95	98	95
query43	619	521	557	521
query44	1225	743	743	743
query45	292	268	283	268
query46	1075	757	751	751
query47	2025	1918	1952	1918
query48	385	303	292	292
query49	831	378	372	372
query50	789	379	393	379
query51	6966	6710	6739	6710
query52	103	93	85	85
query53	342	279	277	277
query54	246	238	219	219
query55	76	72	71	71
query56	234	220	218	218
query57	1195	1151	1121	1121
query58	233	201	201	201
query59	3281	3270	3207	3207
query60	250	225	233	225
query61	90	102	91	91
query62	581	440	423	423
query63	300	281	280	280
query64	4241	3717	3882	3717
query65	3079	3004	3050	3004
query66	729	318	317	317
query67	15395	15265	15044	15044
query68	4350	536	522	522
query69	460	291	295	291
query70	1203	1118	1146	1118
query71	327	265	266	265
query72	6501	2609	2481	2481
query73	705	312	311	311
query74	6822	6290	6344	6290
query75	3342	2676	2701	2676
query76	1776	1071	1122	1071
query77	640	236	259	236
query78	10934	10323	10084	10084
query79	3652	502	515	502
query80	2205	420	413	413
query81	535	234	232	232
query82	805	104	100	100
query83	339	170	185	170
query84	253	90	80	80
query85	1311	273	261	261
query86	507	299	308	299
query87	3606	3302	3303	3302
query88	5403	2276	2263	2263
query89	481	368	381	368
query90	1819	172	171	171
query91	120	115	95	95
query92	58	46	49	46
query93	5338	502	496	496
query94	1175	178	174	174
query95	362	283	284	283
query96	586	265	258	258
query97	3077	2876	2915	2876
query98	239	224	232	224
query99	1262	859	869	859
Total cold run time: 284308 ms
Total hot run time: 183515 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.08 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 549420dde3854b83e974ad71cc0c6d24b5d18105, 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.67	0.08	0.07
query5	0.50	0.48	0.49
query6	1.47	0.72	0.72
query7	0.02	0.02	0.01
query8	0.05	0.04	0.04
query9	0.54	0.50	0.49
query10	0.56	0.56	0.54
query11	0.16	0.12	0.12
query12	0.14	0.12	0.11
query13	0.59	0.59	0.58
query14	0.76	0.78	0.79
query15	0.81	0.80	0.80
query16	0.36	0.39	0.36
query17	0.96	1.01	1.02
query18	0.23	0.24	0.22
query19	1.84	1.71	1.68
query20	0.01	0.02	0.01
query21	15.43	0.65	0.65
query22	4.33	7.52	1.55
query23	18.28	1.37	1.33
query24	1.85	0.24	0.24
query25	0.14	0.07	0.07
query26	0.27	0.16	0.16
query27	0.09	0.07	0.09
query28	13.31	1.01	0.98
query29	12.62	3.26	3.30
query30	0.26	0.06	0.06
query31	2.84	0.37	0.37
query32	3.29	0.46	0.45
query33	2.86	2.83	2.85
query34	17.20	4.40	4.38
query35	4.51	4.47	4.49
query36	0.65	0.46	0.46
query37	0.19	0.15	0.16
query38	0.15	0.15	0.14
query39	0.04	0.03	0.04
query40	0.17	0.14	0.14
query41	0.10	0.05	0.05
query42	0.06	0.05	0.05
query43	0.04	0.04	0.04
Total cold run time: 109.7 s
Total hot run time: 30.08 s

@doris-robot
Copy link

Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Load test result on commit 549420dde3854b83e974ad71cc0c6d24b5d18105 with default session variables
Stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
Stream load orc:          58 seconds loaded 1101869774 Bytes, about 18 MB/s
Stream load parquet:      32 seconds loaded 861443392 Bytes, about 25 MB/s
Insert into select:       13.4 seconds inserted 10000000 Rows, about 746K ops/s

@feiniaofeiafei
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17613	4322	4243	4243
q2	2009	187	184	184
q3	10462	1198	1196	1196
q4	10179	733	766	733
q5	7511	2696	2615	2615
q6	210	128	130	128
q7	996	608	579	579
q8	9199	2048	2031	2031
q9	7886	6574	6548	6548
q10	8440	3510	3521	3510
q11	455	234	230	230
q12	508	213	207	207
q13	18257	2928	2890	2890
q14	268	242	231	231
q15	511	467	475	467
q16	507	391	393	391
q17	950	658	726	658
q18	7275	6719	6618	6618
q19	5475	1533	1476	1476
q20	678	326	301	301
q21	3483	2687	2901	2687
q22	350	305	308	305
Total cold run time: 113222 ms
Total hot run time: 38228 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4353	4258	4233	4233
q2	378	272	275	272
q3	2948	2753	2757	2753
q4	1852	1542	1607	1542
q5	5331	5320	5297	5297
q6	208	122	121	121
q7	2209	1891	1863	1863
q8	3201	3341	3334	3334
q9	8572	8587	8585	8585
q10	4080	3897	4055	3897
q11	589	489	483	483
q12	807	649	645	645
q13	17375	3149	3118	3118
q14	319	308	305	305
q15	533	470	476	470
q16	506	465	457	457
q17	1801	1517	1524	1517
q18	8063	8036	7783	7783
q19	1681	1583	1642	1583
q20	2043	1836	1835	1835
q21	5108	5032	4944	4944
q22	552	472	449	449
Total cold run time: 72509 ms
Total hot run time: 55486 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 182733 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 f4360aad888b485f062fbc2345a238233fa4fedf, data reload: false

query1	883	1136	1099	1099
query2	7796	2467	2239	2239
query3	6662	204	200	200
query4	37116	21676	21347	21347
query5	4123	384	382	382
query6	222	178	175	175
query7	4040	281	284	281
query8	230	166	166	166
query9	5771	2269	2254	2254
query10	366	235	238	235
query11	14789	14229	14188	14188
query12	141	86	88	86
query13	998	349	353	349
query14	8729	6898	6711	6711
query15	213	172	183	172
query16	6797	268	262	262
query17	1613	578	567	567
query18	1409	285	276	276
query19	198	156	154	154
query20	95	87	91	87
query21	200	126	123	123
query22	5116	4921	4868	4868
query23	33799	32937	33239	32937
query24	12042	3104	2971	2971
query25	559	386	376	376
query26	1379	161	160	160
query27	2901	362	370	362
query28	6760	2103	2046	2046
query29	857	617	605	605
query30	275	175	164	164
query31	938	805	744	744
query32	64	54	52	52
query33	576	265	243	243
query34	1021	491	527	491
query35	870	702	740	702
query36	1048	947	931	931
query37	109	67	70	67
query38	3511	3431	3418	3418
query39	1614	1593	1579	1579
query40	169	130	126	126
query41	51	42	42	42
query42	104	95	94	94
query43	586	505	514	505
query44	1276	738	729	729
query45	291	271	246	246
query46	1071	779	733	733
query47	2051	1992	2007	1992
query48	380	305	292	292
query49	862	372	368	368
query50	775	380	395	380
query51	6927	6641	6752	6641
query52	105	85	94	85
query53	346	273	266	266
query54	247	221	221	221
query55	74	71	67	67
query56	234	219	218	218
query57	1225	1150	1123	1123
query58	236	205	200	200
query59	3328	3133	3040	3040
query60	246	231	231	231
query61	90	89	88	88
query62	601	428	425	425
query63	296	268	267	267
query64	4100	4001	3335	3335
query65	3037	3004	3011	3004
query66	733	316	319	316
query67	15501	14906	14962	14906
query68	7044	528	532	528
query69	526	317	297	297
query70	1316	1107	1108	1107
query71	432	273	270	270
query72	6493	2583	2445	2445
query73	826	324	315	315
query74	7002	6397	6464	6397
query75	3415	2680	2595	2595
query76	4204	1088	1138	1088
query77	618	244	249	244
query78	10964	10253	10118	10118
query79	6929	510	504	504
query80	1892	420	417	417
query81	571	230	235	230
query82	1605	90	95	90
query83	324	169	162	162
query84	259	79	84	79
query85	1316	267	254	254
query86	471	289	295	289
query87	3421	3220	3246	3220
query88	5938	2259	2360	2259
query89	465	366	365	365
query90	1886	168	174	168
query91	117	94	96	94
query92	58	45	46	45
query93	5944	501	495	495
query94	1064	177	172	172
query95	376	279	287	279
query96	605	258	255	255
query97	3061	2892	2920	2892
query98	232	219	220	219
query99	1218	898	832	832
Total cold run time: 301364 ms
Total hot run time: 182733 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.07	0.03	0.04
query3	0.23	0.05	0.05
query4	1.67	0.09	0.08
query5	0.50	0.48	0.51
query6	1.47	0.72	0.71
query7	0.02	0.01	0.01
query8	0.05	0.04	0.04
query9	0.56	0.50	0.49
query10	0.55	0.56	0.55
query11	0.14	0.11	0.11
query12	0.14	0.12	0.12
query13	0.62	0.58	0.59
query14	0.75	0.78	0.80
query15	0.83	0.81	0.82
query16	0.36	0.36	0.40
query17	1.01	0.95	1.05
query18	0.23	0.23	0.24
query19	1.84	1.74	1.80
query20	0.02	0.01	0.01
query21	15.42	0.64	0.65
query22	3.94	7.14	2.11
query23	18.28	1.40	1.28
query24	1.84	0.24	0.21
query25	0.15	0.08	0.08
query26	0.28	0.16	0.15
query27	0.07	0.08	0.07
query28	13.50	1.01	0.98
query29	12.90	3.31	3.30
query30	0.27	0.06	0.06
query31	2.88	0.37	0.37
query32	3.30	0.46	0.47
query33	2.86	2.82	2.79
query34	17.17	4.41	4.42
query35	4.46	4.47	4.48
query36	0.65	0.47	0.46
query37	0.18	0.16	0.15
query38	0.16	0.14	0.14
query39	0.04	0.03	0.03
query40	0.17	0.14	0.14
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.81 s
Total hot run time: 30.57 s

@doris-robot
Copy link

Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Load test result on commit f4360aad888b485f062fbc2345a238233fa4fedf with default session variables
Stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
Stream load orc:          58 seconds loaded 1101869774 Bytes, about 18 MB/s
Stream load parquet:      32 seconds loaded 861443392 Bytes, about 25 MB/s
Insert into select:       14.1 seconds inserted 10000000 Rows, about 709K ops/s

@feiniaofeiafei
Copy link
Contributor Author

run external

@feiniaofeiafei
Copy link
Contributor Author

run external regression

@feiniaofeiafei
Copy link
Contributor Author

run external

@feiniaofeiafei
Copy link
Contributor Author

run external regression

@feiniaofeiafei
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	7223	4315	4264	4264
q2	1708	200	193	193
q3	6144	1110	1151	1110
q4	1651	765	738	738
q5	2676	2679	2799	2679
q6	295	157	144	144
q7	1032	602	583	583
q8	1998	2037	2046	2037
q9	6573	6597	6558	6558
q10	8436	3549	3528	3528
q11	454	229	239	229
q12	387	225	224	224
q13	16859	2939	2955	2939
q14	284	234	228	228
q15	537	497	491	491
q16	501	401	376	376
q17	928	628	721	628
q18	7355	6850	6753	6753
q19	1631	1480	1507	1480
q20	880	322	302	302
q21	3545	2790	2872	2790
q22	373	307	309	307
Total cold run time: 71470 ms
Total hot run time: 38581 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4258	4205	4220	4205
q2	365	262	255	255
q3	3021	2724	2685	2685
q4	1880	1578	1553	1553
q5	5331	5313	5332	5313
q6	209	121	123	121
q7	2232	1823	1867	1823
q8	3211	3369	3314	3314
q9	8587	8539	8606	8539
q10	3888	3624	3701	3624
q11	584	481	475	475
q12	760	593	587	587
q13	15972	2948	2931	2931
q14	299	275	284	275
q15	518	477	469	469
q16	458	424	421	421
q17	1790	1550	1535	1535
q18	8115	7978	7711	7711
q19	1696	1593	1580	1580
q20	2069	1822	1821	1821
q21	5337	4991	5004	4991
q22	553	474	459	459
Total cold run time: 71133 ms
Total hot run time: 54687 ms

@feiniaofeiafei
Copy link
Contributor Author

run p0

1 similar comment
@feiniaofeiafei
Copy link
Contributor Author

run p0

Comment on lines 115 to 129















Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this?

* select max(c1) over(partition by pk) from t1;
* -> select c1 from t1;
* */
public class SimplifyWindowExpression extends OneRewriteRuleFactory {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add annotation @DependsRules for denpends on normalize window

Alias alias = (Alias) expr;
WindowExpression windowExpression = (WindowExpression) alias.child();
if (!windowExpression.getOrderKeys().isEmpty()) {
remainWindowExpression.add(expr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if partition key is unique, order key is not use anymore, so why remain them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LogicalWindow
->
LogicalProject(projections)
+ LogicalWindow(remainWindowExpression)
remainWindowExpressions are the WindowExpressions that don't meet the conditions for optimization, and still need to be evaluated int LogicalWindow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tthe restriction has been removed

Comment on lines 109 to 110
return new LogicalProject(projections, window.withExpression(remainWindow,
window.child(0)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do u have case to test this branch? i think this is not right because project should contain remain window node's output

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem has been modified and regression cases have been added

@feiniaofeiafei
Copy link
Contributor Author

run buildall

@feiniaofeiafei
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17629	4231	4240	4231
q2	2017	187	183	183
q3	10431	1175	1156	1156
q4	10188	767	826	767
q5	7528	2627	2662	2627
q6	217	131	132	131
q7	983	595	579	579
q8	9226	2033	2028	2028
q9	7293	6524	6457	6457
q10	8443	3507	3481	3481
q11	442	224	230	224
q12	482	215	214	214
q13	18868	2951	2913	2913
q14	271	236	244	236
q15	524	474	471	471
q16	519	372	374	372
q17	950	689	662	662
q18	7316	6845	6572	6572
q19	5667	1532	1495	1495
q20	639	324	297	297
q21	3471	2767	2788	2767
q22	356	306	309	306
Total cold run time: 113460 ms
Total hot run time: 38169 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4357	4208	4217	4208
q2	364	271	263	263
q3	2979	2756	2703	2703
q4	1858	1547	1584	1547
q5	5348	5327	5278	5278
q6	214	122	121	121
q7	2220	1876	1840	1840
q8	3169	3353	3293	3293
q9	8466	8505	8546	8505
q10	4071	3892	3970	3892
q11	639	494	508	494
q12	799	612	634	612
q13	16855	3378	3184	3184
q14	324	296	264	264
q15	511	472	497	472
q16	510	446	443	443
q17	1813	1553	1518	1518
q18	8117	8113	7856	7856
q19	1669	1540	1538	1538
q20	2036	1842	1808	1808
q21	5150	4860	4842	4842
q22	534	472	479	472
Total cold run time: 72003 ms
Total hot run time: 55153 ms

@feiniaofeiafei
Copy link
Contributor Author

run buildall

@feiniaofeiafei
Copy link
Contributor Author

run buildall

1 similar comment
@feiniaofeiafei
Copy link
Contributor Author

run buildall

@feiniaofeiafei
Copy link
Contributor Author

run p0

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

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@morrySnow morrySnow merged commit 2e8a2a6 into apache:master Apr 24, 2024
yiguolei pushed a commit that referenced this pull request Apr 24, 2024
rewrite func(para) over (partition by unique_keys)
1. func() is count(non-null) or rank/dense_rank/row_number -> 1
2. func(para) is min/max/sum/avg/first_value/last_value -> para
 e.g
select max(c1) over(partition by pk) from t1;
-> select c1 from t1;
yiguolei pushed a commit that referenced this pull request Apr 24, 2024
rewrite func(para) over (partition by unique_keys)
1. func() is count(non-null) or rank/dense_rank/row_number -> 1
2. func(para) is min/max/sum/avg/first_value/last_value -> para
 e.g
select max(c1) over(partition by pk) from t1;
-> select c1 from t1;
yiguolei pushed a commit that referenced this pull request Apr 25, 2024
rewrite func(para) over (partition by unique_keys)
1. func() is count(non-null) or rank/dense_rank/row_number -> 1
2. func(para) is min/max/sum/avg/first_value/last_value -> para
 e.g
select max(c1) over(partition by pk) from t1;
-> select c1 from t1;
morrySnow added a commit that referenced this pull request Jul 1, 2024
…37061)

intro by #33647

after window expression rewritten by literal.
literal's data type should same with original window expression.
dataroaring pushed a commit that referenced this pull request Jul 2, 2024
…37061)

intro by #33647

after window expression rewritten by literal.
literal's data type should same with original window expression.
morningman pushed a commit to morningman/doris that referenced this pull request Jul 9, 2024
…pache#37061)

intro by apache#33647

after window expression rewritten by literal.
literal's data type should same with original window expression.
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. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants