Skip to content

Eager agg 0209#60605

Draft
englefly wants to merge 10 commits intoapache:masterfrom
englefly:eager-agg-0209
Draft

Eager agg 0209#60605
englefly wants to merge 10 commits intoapache:masterfrom
englefly:eager-agg-0209

Conversation

@englefly
Copy link
Contributor

@englefly englefly commented Feb 9, 2026

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Thearas
Copy link
Contributor

Thearas commented Feb 9, 2026

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

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@englefly englefly force-pushed the eager-agg-0209 branch 2 times, most recently from f4f5719 to ce1f61c Compare February 11, 2026 02:01
@englefly
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17606	4407	4269	4269
q2	2008	347	232	232
q3	10221	1332	760	760
q4	10201	785	316	316
q5	7559	2239	1945	1945
q6	201	180	149	149
q7	928	744	623	623
q8	9312	1403	1365	1365
q9	4793	4661	4585	4585
q10	6485	2210	1834	1834
q11	473	258	227	227
q12	386	379	225	225
q13	18092	3047	2248	2248
q14	228	235	210	210
q15	894	811	811	811
q16	700	700	635	635
q17	706	802	538	538
q18	6533	5850	5678	5678
q19	1099	999	620	620
q20	502	502	397	397
q21	2552	1836	1775	1775
q22	328	272	239	239
Total cold run time: 101807 ms
Total hot run time: 29681 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4381	4361	4337	4337
q2	257	334	264	264
q3	4097	4755	4209	4209
q4	1337	1755	1326	1326
q5	4269	4198	4225	4198
q6	215	179	140	140
q7	1872	1803	2039	1803
q8	2621	2519	2434	2434
q9	7624	7716	7374	7374
q10	4377	4717	4483	4483
q11	524	469	437	437
q12	662	760	596	596
q13	2763	3337	2453	2453
q14	308	329	300	300
q15	891	889	829	829
q16	682	735	676	676
q17	1117	1286	1338	1286
q18	8479	7979	8028	7979
q19	905	842	852	842
q20	2047	2154	1966	1966
q21	4690	4229	4153	4153
q22	520	473	413	413
Total cold run time: 54638 ms
Total hot run time: 52498 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 160452 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 3ec5a56ef8a78be3c1bee4632eb38d1577461962, data reload: false

query5	4320	615	493	493
query6	333	223	200	200
query7	4223	460	263	263
query8	337	239	222	222
query9	8719	2700	2705	2700
query10	485	384	343	343
query11	7038	5666	5432	5432
query12	177	118	114	114
query13	1245	453	346	346
query14	5740	3842	3629	3629
query14_1	2802	2802	2839	2802
query15	203	199	174	174
query16	992	528	467	467
query17	1096	694	609	609
query18	2439	450	356	356
query19	217	212	183	183
query20	125	129	129	129
query21	221	152	137	137
query22	4889	4964	4795	4795
query23	17377	16881	16842	16842
query23_1	16845	16808	16757	16757
query24	7198	1596	1203	1203
query24_1	1209	1208	1222	1208
query25	521	468	441	441
query26	1259	268	154	154
query27	2759	470	297	297
query28	4512	1860	1871	1860
query29	824	561	474	474
query30	316	254	220	220
query31	1372	1337	1244	1244
query32	86	77	87	77
query33	535	338	288	288
query34	929	934	561	561
query35	639	686	613	613
query36	1075	1138	1037	1037
query37	144	104	88	88
query38	2970	2977	2926	2926
query39	937	931	900	900
query39_1	882	887	878	878
query40	221	143	122	122
query41	74	67	67	67
query42	327	320	302	302
query43	270	252	230	230
query44	1314	714	720	714
query45	197	199	185	185
query46	907	984	598	598
query47	2192	2231	2095	2095
query48	318	317	230	230
query49	597	425	350	350
query50	690	288	225	225
query51	4175	4063	4148	4063
query52	295	310	281	281
query53	287	319	271	271
query54	298	273	264	264
query55	87	90	85	85
query56	310	314	301	301
query57	1367	1410	1262	1262
query58	273	261	257	257
query59	1387	1456	1280	1280
query60	341	328	316	316
query61	149	154	143	143
query62	615	576	551	551
query63	298	265	264	264
query64	4927	1233	963	963
query65	4552	4458	4383	4383
query66	1464	467	342	342
query67	16440	16509	16302	16302
query68	2457	1074	709	709
query69	413	332	291	291
query70	1005	933	945	933
query71	337	311	305	305
query72	2906	2835	2604	2604
query73	522	565	315	315
query74	9763	9673	9589	9589
query75	2800	2795	2455	2455
query76	2252	1052	645	645
query77	347	373	285	285
query78	11260	11504	10839	10839
query79	1058	932	571	571
query80	1316	560	501	501
query81	574	285	248	248
query82	991	151	114	114
query83	359	260	248	248
query84	247	117	100	100
query85	902	485	409	409
query86	409	316	320	316
query87	3096	3091	3072	3072
query88	3539	2684	2651	2651
query89	379	353	308	308
query90	1938	187	176	176
query91	163	157	143	143
query92	75	79	70	70
query93	924	839	477	477
query94	638	337	283	283
query95	601	339	382	339
query96	632	515	235	235
query97	2501	2504	2436	2436
query98	222	218	206	206
query99	946	925	897	897
Total cold run time: 242645 ms
Total hot run time: 160452 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.04
query2	0.09	0.04	0.04
query3	0.26	0.08	0.08
query4	1.61	0.11	0.10
query5	0.27	0.26	0.25
query6	1.16	0.67	0.67
query7	0.03	0.03	0.02
query8	0.06	0.04	0.04
query9	0.56	0.50	0.49
query10	0.55	0.54	0.54
query11	0.15	0.10	0.09
query12	0.14	0.11	0.10
query13	0.64	0.62	0.61
query14	1.06	1.07	1.04
query15	0.87	0.88	0.87
query16	0.39	0.39	0.40
query17	1.12	1.09	1.10
query18	0.21	0.22	0.21
query19	2.09	1.98	2.10
query20	0.02	0.02	0.01
query21	16.27	0.28	0.15
query22	5.15	0.06	0.05
query23	15.95	0.28	0.11
query24	0.99	0.64	0.35
query25	0.09	0.08	0.06
query26	0.15	0.13	0.13
query27	0.09	0.06	0.06
query28	4.22	1.16	0.97
query29	12.61	3.93	3.14
query30	0.28	0.12	0.10
query31	2.81	0.66	0.42
query32	3.25	0.61	0.52
query33	3.29	3.30	3.26
query34	16.29	5.41	4.74
query35	4.79	4.78	4.75
query36	0.65	0.49	0.51
query37	0.12	0.07	0.07
query38	0.08	0.04	0.04
query39	0.05	0.03	0.03
query40	0.19	0.17	0.16
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 98.82 s
Total hot run time: 28.35 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 70.16% (442/630) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 83.17% (524/630) 🎉
Increment coverage report
Complete coverage report

englefly and others added 7 commits February 13, 2026 10:26
ds14 增加了agg push,执行时间 4.7 -> 4.8
h13 增加了 agg push,应该让p6 恢复到 p4 的成绩,提高一些

当任一 group key的ndv 接近 行数(0.9 倍)时,不下推agg

DORIS-24367 case-when 不能下推join 补null的一侧

pick unnest-subquery-cte

ut-tmp

adjust rt

update-shape

fix eager_agg.groovy, runtime_filter_mode=OFF;

fmt

14/67 因为rebase后增加了 repeat 拆分, 形状变化

支持  min(if), max(if), 增加了context.isValid检查,避免无效下推

doris-24240: rewriteRoot 检查nullable失败则不做eagerAgg

column pruning 不产生不合法 的setOp

24207-2: orExpansion union 字段没对齐

DORIS-24239 context.groupKeys 不能为空

DORIS-24206: fix EliminateGroupByKeyByUniform bug:没有替换alias的exprId

DORIS-24205
1. union 的孩子不能部分改写
2. agg 输入字段和 group key 有交集,则不下推

LogicalProject 构造projectMap时不能有unbound

DORIS-23842 没有aggFunc时 下推包含所有group key
的分支,而不是大分支. ds37/38/82/87 受到影响。select distinct A from T1 join T2 on ... group by A`

aliasMap 使用HashMap,不用IdentityMap

DORIS-24149

DORIS-24151

doris-24150 rt case

1. exprId 的等值判断, 2.update rt.

DORIS-24150

update shape

remove unused code

1. sum-if 不考虑穿过bigJoin, 2. 支持union

q5 两个sum(0)错误去重了

sum-if 基本款 (还没有支持union), 43 有提升

simple sum-if no union

检查context的字段 是project的输出.拒绝 sum(A) 下推 proj(x, x+y as A) 且x 不是group key

derive deep false

throw exception for eager agg when FeDebug

1. remove finalGroupKeys, 2. project 下推后改写projects

push agg on join

group key only slotreference

do not support avg/count

mode=1 时 即使没有经过big join 也要 强制 下推

shape with/without pkfk based on tpc_preview
@englefly
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
============================================
q1	17654	4452	4292	4292
q2	q3	10656	826	511	511
q4	4692	371	253	253
q5	7565	1215	1002	1002
q6	183	171	146	146
q7	795	871	667	667
q8	9294	1490	1412	1412
q9	4886	4791	4727	4727
q10	6312	1908	1657	1657
q11	466	273	233	233
q12	711	566	473	473
q13	18055	2986	2191	2191
q14	228	229	221	221
q15	938	804	804	804
q16	760	723	665	665
q17	731	849	428	428
q18	6113	5443	5203	5203
q19	1240	1008	638	638
q20	506	500	395	395
q21	4688	2180	1542	1542
q22	402	353	275	275
Total cold run time: 96875 ms
Total hot run time: 27735 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4696	4517	4531	4517
q2	q3	3884	4336	3835	3835
q4	886	1202	757	757
q5	4078	4416	4437	4416
q6	190	179	147	147
q7	1752	1656	1500	1500
q8	2529	2922	2571	2571
q9	7787	7441	7429	7429
q10	3744	3916	3608	3608
q11	502	422	433	422
q12	495	603	440	440
q13	2779	3179	2352	2352
q14	282	290	275	275
q15	886	836	801	801
q16	693	775	722	722
q17	1150	1455	1379	1379
q18	7143	6772	6634	6634
q19	864	883	923	883
q20	2103	2195	2203	2195
q21	3962	3520	3307	3307
q22	499	446	395	395
Total cold run time: 50904 ms
Total hot run time: 48585 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 153349 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 052aaec703ab69f27a14367973603f322b237d09, data reload: false

query5	4326	631	512	512
query6	315	221	205	205
query7	4202	490	255	255
query8	331	239	227	227
query9	8651	2718	2696	2696
query10	540	398	342	342
query11	7270	5930	5621	5621
query12	181	127	123	123
query13	1266	458	343	343
query14	5662	3794	3639	3639
query14_1	2830	2815	2828	2815
query15	212	194	176	176
query16	983	475	473	473
query17	1115	714	613	613
query18	2435	450	351	351
query19	222	210	211	210
query20	131	123	127	123
query21	225	142	123	123
query22	4798	5091	4792	4792
query23	16813	16214	15875	15875
query23_1	16062	15885	15723	15723
query24	7849	1716	1213	1213
query24_1	1235	1232	1217	1217
query25	528	463	389	389
query26	1234	265	147	147
query27	2800	471	285	285
query28	4549	1841	1838	1838
query29	796	562	502	502
query30	313	250	211	211
query31	1403	1319	1242	1242
query32	81	75	75	75
query33	501	338	272	272
query34	961	955	571	571
query35	634	671	590	590
query36	1110	1114	975	975
query37	137	93	81	81
query38	2964	2942	2842	2842
query39	844	845	834	834
query39_1	824	802	802	802
query40	230	154	134	134
query41	62	58	58	58
query42	313	321	316	316
query43	243	262	224	224
query44	
query45	199	192	177	177
query46	901	988	592	592
query47	2117	2147	2024	2024
query48	322	324	223	223
query49	622	465	392	392
query50	695	285	216	216
query51	4196	4136	4110	4110
query52	294	317	293	293
query53	295	331	281	281
query54	293	278	257	257
query55	91	93	94	93
query56	322	321	316	316
query57	1351	1326	1288	1288
query58	291	277	266	266
query59	1371	1456	1277	1277
query60	345	332	359	332
query61	155	147	142	142
query62	631	569	534	534
query63	315	289	279	279
query64	4877	1246	981	981
query65	
query66	1463	448	349	349
query67	16594	16315	16438	16315
query68	
query69	393	308	285	285
query70	980	981	918	918
query71	341	305	306	305
query72	2774	2698	2627	2627
query73	558	560	323	323
query74	9718	9533	9335	9335
query75	2881	2768	2472	2472
query76	2272	1030	689	689
query77	365	399	320	320
query78	11725	11789	11023	11023
query79	1167	798	626	626
query80	738	685	555	555
query81	493	283	262	262
query82	1378	150	123	123
query83	379	278	259	259
query84	259	130	101	101
query85	931	562	504	504
query86	368	307	294	294
query87	3145	3136	3017	3017
query88	3561	2651	2623	2623
query89	419	364	337	337
query90	1966	188	182	182
query91	167	158	135	135
query92	80	75	73	73
query93	900	829	504	504
query94	463	321	307	307
query95	608	387	317	317
query96	653	534	229	229
query97	2422	2485	2404	2404
query98	226	229	229	229
query99	966	1007	910	910
Total cold run time: 233646 ms
Total hot run time: 153349 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants