doris icon indicating copy to clipboard operation
doris copied to clipboard

[exec](agg) multi merge sort opt the PERCENTILE

Open HappenLee opened this issue 10 months ago • 11 comments

Proposed changes

Before:

select PERCENTILE(lo_orderkey, 0.5) from lineorder;
+--------------------------------------------------------------+
| percentile(cast(lo_orderkey as BIGINT), cast(0.5 as DOUBLE)) |
+--------------------------------------------------------------+
|                                                    300013154 |
+--------------------------------------------------------------+
1 row in set (1min49 sec)

After:

select PERCENTILE(lo_orderkey, 0.5) from lineorder;
+--------------------------------------------------------------+
| percentile(cast(lo_orderkey as BIGINT), cast(0.5 as DOUBLE)) |
+--------------------------------------------------------------+
|                                                    300013154 |
+--------------------------------------------------------------+
1 row in set (14.99 sec)

Further comments

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

HappenLee avatar May 02 '24 04:05 HappenLee

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.

doris-robot avatar May 02 '24 04:05 doris-robot

run buildall

HappenLee avatar May 02 '24 04:05 HappenLee

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar May 02 '24 04:05 github-actions[bot]

run buildall

HappenLee avatar May 02 '24 09:05 HappenLee

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar May 02 '24 09:05 github-actions[bot]

TeamCity be ut coverage result: Function Coverage: 35.67% (8964/25133) Line Coverage: 27.28% (73970/271117) Region Coverage: 26.47% (38206/144350) Branch Coverage: 23.22% (19461/83814) Coverage Report: http://coverage.selectdb-in.cc/coverage/fa5b2c748e1c1025d8a0adef1b2c3e03d9059adc_fa5b2c748e1c1025d8a0adef1b2c3e03d9059adc/report/index.html

doris-robot avatar May 02 '24 10:05 doris-robot

run buildall

HappenLee avatar May 02 '24 12:05 HappenLee

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar May 02 '24 12:05 github-actions[bot]

TeamCity be ut coverage result: Function Coverage: 35.67% (8964/25133) Line Coverage: 27.29% (73983/271117) Region Coverage: 26.48% (38219/144350) Branch Coverage: 23.23% (19467/83814) Coverage Report: http://coverage.selectdb-in.cc/coverage/31e25bb4f63f2fbc976f949a55fb0eb2b4dcf606_31e25bb4f63f2fbc976f949a55fb0eb2b4dcf606/report/index.html

doris-robot avatar May 02 '24 12:05 doris-robot

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

------ Round 1 ----------------------------------
q1	17603	4301	4224	4224
q2	2024	186	199	186
q3	10468	1260	1176	1176
q4	10200	839	803	803
q5	7477	2710	2729	2710
q6	227	133	132	132
q7	1040	615	609	609
q8	9225	2160	2116	2116
q9	9444	6827	6764	6764
q10	9767	3848	3897	3848
q11	471	236	249	236
q12	430	225	221	221
q13	18238	3123	3255	3123
q14	257	214	214	214
q15	511	469	474	469
q16	497	403	391	391
q17	963	693	702	693
q18	8226	7694	7748	7694
q19	3163	1570	1550	1550
q20	635	321	321	321
q21	5289	3998	4169	3998
q22	347	272	299	272
Total cold run time: 116502 ms
Total hot run time: 41750 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4540	4434	4378	4378
q2	380	268	279	268
q3	3196	2906	2847	2847
q4	1954	1658	1659	1658
q5	5492	5506	5503	5503
q6	215	127	126	126
q7	2304	1994	1975	1975
q8	3266	3393	3388	3388
q9	8700	8761	8834	8761
q10	3905	3780	3863	3780
q11	583	483	502	483
q12	784	619	667	619
q13	15968	3157	3216	3157
q14	293	277	280	277
q15	526	491	473	473
q16	483	427	439	427
q17	1755	1492	1458	1458
q18	7654	7751	7406	7406
q19	4261	1571	1525	1525
q20	1970	1797	1753	1753
q21	9055	4818	4806	4806
q22	586	486	508	486
Total cold run time: 77870 ms
Total hot run time: 55554 ms

doris-robot avatar May 02 '24 12:05 doris-robot

TPC-DS: Total hot run time: 186071 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 31e25bb4f63f2fbc976f949a55fb0eb2b4dcf606, data reload: false

query1	924	359	353	353
query2	6451	2437	2226	2226
query3	6656	201	205	201
query4	22888	21151	21178	21151
query5	4099	426	423	423
query6	263	182	180	180
query7	4589	291	300	291
query8	250	201	190	190
query9	8522	2318	2303	2303
query10	439	253	255	253
query11	14777	14152	14167	14152
query12	138	92	88	88
query13	1653	368	371	368
query14	8769	7688	7522	7522
query15	245	168	168	168
query16	8080	258	259	258
query17	1759	556	540	540
query18	2116	280	266	266
query19	231	153	142	142
query20	92	84	84	84
query21	190	125	130	125
query22	4924	4780	4772	4772
query23	33790	33203	33174	33174
query24	6665	2866	2878	2866
query25	570	359	365	359
query26	700	155	148	148
query27	2095	316	330	316
query28	4870	2005	1989	1989
query29	851	606	596	596
query30	259	156	152	152
query31	981	744	722	722
query32	98	52	54	52
query33	514	248	244	244
query34	881	471	469	469
query35	778	681	670	670
query36	1015	931	915	915
query37	105	66	67	66
query38	3140	2981	2981	2981
query39	1557	1531	1534	1531
query40	204	134	129	129
query41	45	44	44	44
query42	112	101	103	101
query43	585	534	541	534
query44	1083	745	763	745
query45	270	264	261	261
query46	1070	699	710	699
query47	1938	1849	1860	1849
query48	374	314	297	297
query49	856	396	411	396
query50	782	394	381	381
query51	6741	6664	6577	6577
query52	109	90	92	90
query53	359	285	284	284
query54	273	243	250	243
query55	83	75	75	75
query56	251	228	233	228
query57	1226	1167	1139	1139
query58	233	209	214	209
query59	3416	3410	3375	3375
query60	265	245	248	245
query61	110	107	113	107
query62	603	455	444	444
query63	308	282	283	282
query64	8408	7340	7267	7267
query65	3128	3070	3087	3070
query66	804	348	347	347
query67	15466	14877	15004	14877
query68	7323	538	529	529
query69	551	313	310	310
query70	1222	1029	1136	1029
query71	470	275	275	275
query72	8399	2575	2402	2402
query73	741	323	316	316
query74	6567	6052	6080	6052
query75	4127	2633	2650	2633
query76	4615	966	959	959
query77	701	264	267	264
query78	11011	10266	10169	10169
query79	12546	527	512	512
query80	2216	432	436	432
query81	491	224	221	221
query82	710	97	94	94
query83	210	166	168	166
query84	270	86	86	86
query85	1124	306	265	265
query86	395	266	269	266
query87	3279	3059	3069	3059
query88	5341	2436	2429	2429
query89	546	397	386	386
query90	2057	190	189	189
query91	130	99	98	98
query92	60	48	48	48
query93	7527	531	506	506
query94	1275	189	184	184
query95	403	314	313	313
query96	611	268	266	266
query97	3100	2941	2947	2941
query98	233	219	207	207
query99	1238	864	921	864
Total cold run time: 295515 ms
Total hot run time: 186071 ms

doris-robot avatar May 02 '24 12:05 doris-robot

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

github-actions[bot] avatar May 03 '24 02:05 github-actions[bot]

PR approved by anyone and no changes requested.

github-actions[bot] avatar May 03 '24 02:05 github-actions[bot]