Skip to content

[fix](fe) Prune empty and cascading CTE plans#62828

Open
englefly wants to merge 5 commits into
apache:masterfrom
englefly:fix-cte-empty
Open

[fix](fe) Prune empty and cascading CTE plans#62828
englefly wants to merge 5 commits into
apache:masterfrom
englefly:fix-cte-empty

Conversation

@englefly
Copy link
Copy Markdown
Contributor

@englefly englefly commented Apr 24, 2026

What problem does this PR solve?

Issue Number: None

Related PR: #60601

Problem Summary: Fix optimizer-side CTE pruning so empty-relation producers, zero-consumer anchors, and cascading inline opportunities are normalized to a fixpoint before memoization, and add regression coverage for empty and cascading CTE elimination.

Release note

None

Check List (For Author)

  • Test: No need to test (user requested to skip compile and test)
  • Behavior changed: Yes (empty and cascade-pruned CTEs are normalized before memoization)
  • Does this need documentation: No

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

@hello-stephen
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor Author

/review

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 82.00% (41/50) 🎉
Increment coverage report
Complete coverage report

@github-actions
Copy link
Copy Markdown
Contributor

OpenCode automated review failed and did not complete.

Error: Review step was failure (possibly timeout or cancelled)
Workflow run: https://github.com/apache/doris/actions/runs/24895847727

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 90.00% (45/50) 🎉
Increment coverage report
Complete coverage report

@morrySnow
Copy link
Copy Markdown
Contributor

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I found 2 blocking issues.

Critical checkpoint conclusions:

  • Goal of this PR: partially accomplished. The change does address empty/cascading CTE pruning in the optimizer path, and the new regression suite covers two representative plan shapes, but one fixpoint bug in the new normalization loop means cascading cleanup can still stop too early.
  • Scope/minimality: mostly focused, but the SessionVariable edit also removes a legacy variable alias unrelated to the optimizer fix.
  • Concurrency: no concurrency or locking concerns are introduced in these touched FE optimizer/session-variable paths.
  • Lifecycle/static-init: no special lifecycle or static initialization issues are involved here.
  • Configuration items: no new config was added, but an existing session variable declaration was changed in a user-visible way.
  • Compatibility: not preserved. Removing cbo_cte_inline_mode breaks existing SET / SHOW VARIABLES clients that still use the old alias.
  • Parallel code paths: the new optimizer-side normalization path is distinct from the main rewrite path, and its fixpoint detection currently relies on shallow equals() semantics that do not reflect subtree changes.
  • Special conditions/checks: the new currentPlan.equals(normalizedPlan) stop condition is not strong enough for Nereids plans.
  • Test coverage: improved for empty/cascade pruning, but still missing coverage for the shallow-equality fixpoint case and for preserving the legacy session-variable alias.
  • Test result updates: one new regression test file was added; I did not run the test suite locally in this runner.
  • Observability: no additional observability appears necessary for this change.
  • Transaction/persistence/data-write/FE-BE variable passing: not applicable for this PR.
  • Performance: no blocking performance issue identified beyond the correctness problems above.
  • Other issues: none beyond the two findings below.

User focus: /tmp/review_focus.txt contains no additional focus items, so there were no extra focus-specific findings to report.

Comment thread fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Optimizer.java Outdated
Comment thread fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@englefly
Copy link
Copy Markdown
Contributor Author

englefly commented May 9, 2026

/review

@englefly
Copy link
Copy Markdown
Contributor Author

englefly commented May 9, 2026

run buildall

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I did not add duplicate inline comments because the remaining blocking issue is already covered by the existing review thread on SessionVariable.java: removing the cbo_cte_inline_mode alias is a user-visible compatibility break and should be restored or intentionally documented with a migration plan. The earlier Plan.equals() fixpoint issue appears addressed by the explicit changed flag in the current head.

Critical checkpoint conclusions:

  • Goal/test: The PR targets CTE pruning and cascading inline normalization, with regression coverage added for empty and cascading CTE cases.
  • Scope: The optimizer changes are focused, but the alias removal is unrelated to the optimizer fix and should not be included.
  • Concurrency/lifecycle: No new concurrent mutable state, locks, or special lifecycle hazards identified.
  • Configuration/compatibility: Compatibility issue remains for the removed session-variable alias.
  • Parallel code paths: The new normalization is applied to the base rewrite plan and CBO inline alternatives; no distinct missing path found.
  • Testing: Regression coverage exists for the main CTE pruning behavior; no additional user focus points were provided.
  • Observability/persistence/data writes: Not applicable for this optimizer-only change.
  • Performance: No blocking performance issue found in the changed code; the normalization loop is bounded by CTE removal/inlining progress.

Focus response: review_focus.txt had no additional focus points.

@englefly
Copy link
Copy Markdown
Contributor Author

englefly commented May 9, 2026

run buildall

1 similar comment
@englefly
Copy link
Copy Markdown
Contributor Author

englefly commented May 9, 2026

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17664	3848	3818	3818
q2	q3	10703	867	601	601
q4	4661	452	345	345
q5	7452	1340	1127	1127
q6	182	163	136	136
q7	894	933	757	757
q8	9305	1370	1263	1263
q9	5673	5372	5296	5296
q10	6318	2093	1797	1797
q11	469	264	249	249
q12	688	412	291	291
q13	18203	3360	2755	2755
q14	296	284	261	261
q15	q16	899	890	788	788
q17	932	955	712	712
q18	6391	5731	5516	5516
q19	1172	1234	1082	1082
q20	516	393	259	259
q21	4664	2259	1873	1873
q22	416	361	308	308
Total cold run time: 97498 ms
Total hot run time: 29234 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4164	4061	4077	4061
q2	q3	4669	4749	4191	4191
q4	2096	2168	1393	1393
q5	4984	4953	5254	4953
q6	190	162	129	129
q7	2008	1776	1718	1718
q8	3589	3216	3218	3216
q9	8546	8472	8451	8451
q10	4472	4483	4234	4234
q11	644	459	431	431
q12	720	763	538	538
q13	3258	3638	2970	2970
q14	302	316	273	273
q15	q16	758	788	686	686
q17	1385	1314	1290	1290
q18	8306	7318	7214	7214
q19	1134	1152	1182	1152
q20	2311	2305	2027	2027
q21	6365	5608	5091	5091
q22	600	535	419	419
Total cold run time: 60501 ms
Total hot run time: 54437 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17681	3887	4004	3887
q2	q3	10715	869	604	604
q4	4668	454	353	353
q5	7445	1339	1167	1167
q6	184	171	143	143
q7	899	933	747	747
q8	9313	1383	1312	1312
q9	5628	5436	5390	5390
q10	6257	2066	1810	1810
q11	464	264	258	258
q12	625	413	297	297
q13	18087	3335	2710	2710
q14	295	284	264	264
q15	q16	866	867	793	793
q17	976	1188	617	617
q18	6508	5750	5679	5679
q19	1186	1298	1058	1058
q20	509	399	261	261
q21	4478	2260	1891	1891
q22	419	361	305	305
Total cold run time: 97203 ms
Total hot run time: 29546 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4192	4118	4106	4106
q2	q3	4631	4765	4208	4208
q4	2107	2179	1397	1397
q5	4996	4957	5235	4957
q6	195	161	128	128
q7	2029	1782	1852	1782
q8	3560	3198	3309	3198
q9	8598	8547	8597	8547
q10	4508	4530	4281	4281
q11	628	426	423	423
q12	698	767	511	511
q13	3568	3558	2890	2890
q14	302	321	291	291
q15	q16	795	787	689	689
q17	1344	1327	1309	1309
q18	8099	7133	7219	7133
q19	1149	1135	1155	1135
q20	2271	2291	2007	2007
q21	6198	5497	4933	4933
q22	581	551	420	420
Total cold run time: 60449 ms
Total hot run time: 54345 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 170284 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 418be746556dd12e5577e9cadc4e7811c45adc26, data reload: false

query5	4357	660	530	530
query6	356	238	222	222
query7	4235	563	309	309
query8	339	245	224	224
query9	8849	4072	4037	4037
query10	474	358	302	302
query11	6026	2385	2211	2211
query12	192	134	129	129
query13	1313	613	435	435
query14	6865	5362	5098	5098
query14_1	4369	4395	4385	4385
query15	217	205	185	185
query16	1003	463	441	441
query17	1391	773	650	650
query18	2728	487	347	347
query19	293	195	155	155
query20	142	130	136	130
query21	214	137	117	117
query22	13702	13457	13292	13292
query23	17078	16386	16598	16386
query23_1	16243	16248	16376	16248
query24	7745	1832	1410	1410
query24_1	1382	1372	1365	1365
query25	597	533	470	470
query26	1531	335	174	174
query27	2952	594	354	354
query28	4632	2003	1964	1964
query29	1041	662	513	513
query30	341	236	197	197
query31	1109	1050	927	927
query32	82	74	70	70
query33	529	347	285	285
query34	1139	1146	636	636
query35	746	777	674	674
query36	1326	1314	1133	1133
query37	140	96	84	84
query38	3195	3132	3087	3087
query39	915	914	905	905
query39_1	886	856	872	856
query40	240	154	134	134
query41	64	59	60	59
query42	109	110	107	107
query43	321	328	279	279
query44	
query45	213	202	200	200
query46	1038	1193	727	727
query47	2297	2372	2221	2221
query48	398	410	292	292
query49	637	510	437	437
query50	722	305	214	214
query51	4316	4300	4216	4216
query52	103	102	94	94
query53	259	282	202	202
query54	309	279	249	249
query55	91	87	83	83
query56	301	313	300	300
query57	1398	1426	1316	1316
query58	298	273	250	250
query59	1561	1651	1388	1388
query60	340	335	313	313
query61	157	152	148	148
query62	671	619	572	572
query63	244	201	206	201
query64	2343	816	676	676
query65	
query66	1691	506	395	395
query67	29972	29317	29850	29317
query68	
query69	461	333	306	306
query70	1031	1007	995	995
query71	321	272	268	268
query72	3156	2924	2653	2653
query73	858	734	427	427
query74	5034	4866	4732	4732
query75	2780	2647	2323	2323
query76	2303	1139	778	778
query77	417	426	352	352
query78	12937	12967	12318	12318
query79	1511	948	721	721
query80	1397	588	478	478
query81	520	275	239	239
query82	942	161	127	127
query83	350	273	241	241
query84	266	143	118	118
query85	900	516	438	438
query86	447	323	337	323
query87	3413	3385	3229	3229
query88	3510	2653	2639	2639
query89	440	383	338	338
query90	1916	189	183	183
query91	178	178	141	141
query92	84	75	72	72
query93	1098	969	573	573
query94	704	335	306	306
query95	699	366	338	338
query96	1029	746	350	350
query97	2684	2700	2587	2587
query98	242	233	227	227
query99	1142	1109	978	978
Total cold run time: 256751 ms
Total hot run time: 170284 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 170993 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 6c75a31a3bb122377bae5c87def83c2a8efa4acd, data reload: false

query5	4324	645	543	543
query6	322	237	204	204
query7	4273	572	302	302
query8	316	237	238	237
query9	8836	4060	4062	4060
query10	441	338	290	290
query11	5844	2410	2176	2176
query12	178	130	130	130
query13	1260	608	412	412
query14	6017	5353	5028	5028
query14_1	4360	4341	4334	4334
query15	209	206	181	181
query16	997	449	449	449
query17	913	750	613	613
query18	2473	484	354	354
query19	216	205	159	159
query20	136	133	133	133
query21	216	136	115	115
query22	13551	13552	13432	13432
query23	17179	16500	16601	16500
query23_1	16427	16333	16336	16333
query24	7700	1822	1384	1384
query24_1	1390	1384	1450	1384
query25	608	525	456	456
query26	1514	326	193	193
query27	2714	591	341	341
query28	4472	1960	1936	1936
query29	976	623	509	509
query30	303	235	198	198
query31	1095	1079	941	941
query32	87	69	69	69
query33	522	342	282	282
query34	1153	1120	632	632
query35	770	790	673	673
query36	1317	1349	1209	1209
query37	153	105	91	91
query38	3174	3124	3035	3035
query39	942	947	909	909
query39_1	862	883	864	864
query40	235	165	138	138
query41	72	66	69	66
query42	115	111	107	107
query43	317	328	282	282
query44	
query45	215	203	198	198
query46	1058	1197	722	722
query47	2341	2349	2201	2201
query48	412	427	313	313
query49	652	542	429	429
query50	726	288	219	219
query51	4352	4306	4275	4275
query52	108	106	94	94
query53	256	275	213	213
query54	329	289	282	282
query55	92	91	91	91
query56	323	337	343	337
query57	1465	1377	1298	1298
query58	309	282	274	274
query59	1557	1660	1457	1457
query60	363	349	337	337
query61	184	180	174	174
query62	686	633	565	565
query63	258	209	210	209
query64	2499	873	730	730
query65	
query66	1753	512	413	413
query67	29395	29956	29174	29174
query68	
query69	454	339	311	311
query70	993	1016	973	973
query71	316	276	261	261
query72	3105	2831	2472	2472
query73	808	737	409	409
query74	5082	4934	4745	4745
query75	2804	2680	2325	2325
query76	2301	1126	744	744
query77	405	433	359	359
query78	12960	12998	12386	12386
query79	1479	1027	734	734
query80	1256	578	489	489
query81	502	279	235	235
query82	1306	157	125	125
query83	365	290	255	255
query84	308	136	112	112
query85	937	518	450	450
query86	450	347	313	313
query87	3416	3351	3209	3209
query88	3533	2705	2662	2662
query89	444	380	332	332
query90	1787	185	186	185
query91	183	170	138	138
query92	82	77	70	70
query93	959	945	566	566
query94	642	342	293	293
query95	676	467	363	363
query96	1076	784	350	350
query97	2741	2692	2606	2606
query98	242	237	235	235
query99	1085	1098	911	911
Total cold run time: 254511 ms
Total hot run time: 170993 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 85.48% (53/62) 🎉
Increment coverage report
Complete coverage report

1 similar comment
@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 85.48% (53/62) 🎉
Increment coverage report
Complete coverage report

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17592	3951	3854	3854
q2	q3	10728	867	606	606
q4	4662	459	343	343
q5	7450	1321	1158	1158
q6	193	169	141	141
q7	912	947	749	749
q8	9321	1394	1253	1253
q9	5523	5396	5356	5356
q10	6244	2097	1820	1820
q11	476	263	257	257
q12	627	420	296	296
q13	18098	3308	2727	2727
q14	286	281	262	262
q15	q16	885	866	786	786
q17	927	1012	707	707
q18	6478	5740	5577	5577
q19	1154	1260	1051	1051
q20	495	395	264	264
q21	4835	2382	1994	1994
q22	461	411	338	338
Total cold run time: 97347 ms
Total hot run time: 29539 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4764	4667	4841	4667
q2	q3	4653	4864	4166	4166
q4	2106	2165	1385	1385
q5	4977	4978	5202	4978
q6	190	177	142	142
q7	2089	1816	1623	1623
q8	3321	3059	3120	3059
q9	8541	8105	8473	8105
q10	4540	4519	4227	4227
q11	596	413	392	392
q12	700	744	535	535
q13	3193	3611	2882	2882
q14	301	296	270	270
q15	q16	878	806	684	684
q17	1338	1279	1251	1251
q18	7942	7057	7129	7057
q19	1129	1176	1143	1143
q20	2269	2241	1955	1955
q21	6254	5350	4904	4904
q22	539	511	410	410
Total cold run time: 60320 ms
Total hot run time: 53835 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

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

query5	4312	650	519	519
query6	350	209	193	193
query7	4226	582	321	321
query8	336	227	214	214
query9	8840	3988	4020	3988
query10	446	358	297	297
query11	5902	2394	2193	2193
query12	180	130	124	124
query13	1270	616	428	428
query14	6043	5387	5054	5054
query14_1	4392	4437	4394	4394
query15	214	215	185	185
query16	991	472	445	445
query17	953	769	637	637
query18	2503	491	371	371
query19	227	209	165	165
query20	138	137	133	133
query21	219	141	120	120
query22	13618	13930	14595	13930
query23	17434	16542	16162	16162
query23_1	16324	16328	16284	16284
query24	7409	1752	1341	1341
query24_1	1335	1332	1373	1332
query25	557	493	415	415
query26	1291	316	177	177
query27	2716	600	344	344
query28	4419	1962	1960	1960
query29	989	630	515	515
query30	306	235	200	200
query31	1092	1057	941	941
query32	79	70	70	70
query33	538	340	295	295
query34	1149	1105	633	633
query35	743	773	675	675
query36	1341	1334	1171	1171
query37	145	94	97	94
query38	3157	3109	3073	3073
query39	913	938	893	893
query39_1	882	871	863	863
query40	229	152	135	135
query41	62	60	60	60
query42	109	106	101	101
query43	317	334	276	276
query44	
query45	214	202	190	190
query46	1048	1178	718	718
query47	2281	2289	2182	2182
query48	375	396	296	296
query49	631	520	424	424
query50	710	280	222	222
query51	4283	4264	4188	4188
query52	109	105	96	96
query53	260	289	207	207
query54	320	285	254	254
query55	100	90	83	83
query56	304	316	299	299
query57	1403	1395	1319	1319
query58	289	279	284	279
query59	1528	1627	1451	1451
query60	356	327	325	325
query61	155	154	154	154
query62	673	624	576	576
query63	253	196	212	196
query64	2446	833	692	692
query65	
query66	1734	527	387	387
query67	29965	29905	29862	29862
query68	
query69	461	332	303	303
query70	958	994	1026	994
query71	311	275	259	259
query72	3020	2733	2644	2644
query73	815	740	432	432
query74	5062	4886	4738	4738
query75	2804	2683	2355	2355
query76	2307	1138	789	789
query77	419	423	341	341
query78	12935	13006	12315	12315
query79	1508	1028	718	718
query80	1386	572	476	476
query81	521	284	237	237
query82	958	155	127	127
query83	324	275	256	256
query84	301	143	111	111
query85	908	509	444	444
query86	444	316	298	298
query87	3407	3365	3227	3227
query88	3559	2691	2661	2661
query89	436	378	337	337
query90	1945	182	183	182
query91	181	168	138	138
query92	79	78	72	72
query93	1224	936	577	577
query94	712	329	291	291
query95	663	367	346	346
query96	1044	780	324	324
query97	2698	2694	2547	2547
query98	236	234	237	234
query99	1144	1101	963	963
Total cold run time: 253938 ms
Total hot run time: 171356 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 85.48% (53/62) 🎉
Increment coverage report
Complete coverage report

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 56.00% (56/100) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17818	4066	4066	4066
q2	q3	10720	856	598	598
q4	4672	453	344	344
q5	7471	1311	1140	1140
q6	190	166	140	140
q7	912	962	751	751
q8	9611	1321	1263	1263
q9	6139	5351	5305	5305
q10	6311	2046	1789	1789
q11	468	265	247	247
q12	690	417	287	287
q13	18201	3312	2708	2708
q14	297	281	263	263
q15	q16	903	863	785	785
q17	1050	929	775	775
q18	6348	5718	5537	5537
q19	1491	1220	1079	1079
q20	527	390	262	262
q21	4748	2317	1918	1918
q22	486	405	339	339
Total cold run time: 99053 ms
Total hot run time: 29596 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4666	4540	4592	4540
q2	q3	4668	4773	4206	4206
q4	2071	2151	1378	1378
q5	4934	5094	5242	5094
q6	210	168	139	139
q7	2039	1828	1638	1638
q8	3347	3084	3129	3084
q9	8380	8658	8365	8365
q10	4456	4461	4233	4233
q11	574	407	411	407
q12	703	754	514	514
q13	3290	3629	2907	2907
q14	293	312	281	281
q15	q16	775	773	682	682
q17	1334	1296	1246	1246
q18	7991	7186	7101	7101
q19	1158	1157	1133	1133
q20	2173	2200	1906	1906
q21	5917	5244	4723	4723
q22	509	464	398	398
Total cold run time: 59488 ms
Total hot run time: 53975 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

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

query5	4307	653	513	513
query6	311	219	210	210
query7	4281	583	305	305
query8	325	244	248	244
query9	8850	4114	4074	4074
query10	456	338	298	298
query11	5781	2384	2200	2200
query12	183	129	130	129
query13	1291	601	422	422
query14	6503	5387	5083	5083
query14_1	4409	4416	4375	4375
query15	215	205	195	195
query16	999	460	450	450
query17	1160	780	607	607
query18	2707	486	340	340
query19	221	206	163	163
query20	138	131	138	131
query21	220	146	116	116
query22	13558	13548	13520	13520
query23	17056	16308	15999	15999
query23_1	15960	16127	16128	16127
query24	7423	1731	1360	1360
query24_1	1371	1366	1371	1366
query25	551	496	444	444
query26	1290	325	171	171
query27	2719	636	342	342
query28	4416	1963	2004	1963
query29	1020	620	514	514
query30	330	241	210	210
query31	1128	1062	921	921
query32	91	73	77	73
query33	547	349	284	284
query34	1157	1133	660	660
query35	763	786	662	662
query36	1307	1304	1178	1178
query37	157	108	98	98
query38	3219	3122	3078	3078
query39	922	928	949	928
query39_1	891	880	876	876
query40	234	165	143	143
query41	64	64	62	62
query42	111	118	111	111
query43	336	336	297	297
query44	
query45	207	198	193	193
query46	1121	1218	724	724
query47	2295	2327	2230	2230
query48	366	410	324	324
query49	669	558	470	470
query50	731	312	233	233
query51	4357	4300	4268	4268
query52	106	111	100	100
query53	275	303	228	228
query54	333	313	272	272
query55	98	102	91	91
query56	325	338	329	329
query57	1469	1465	1321	1321
query58	308	294	284	284
query59	1624	1678	1403	1403
query60	368	358	335	335
query61	183	180	179	179
query62	691	637	567	567
query63	263	215	231	215
query64	2471	870	732	732
query65	
query66	1749	545	452	452
query67	29301	29855	29797	29797
query68	
query69	470	331	301	301
query70	1038	962	1029	962
query71	315	281	270	270
query72	3028	2702	2395	2395
query73	825	785	454	454
query74	5089	4886	4725	4725
query75	2780	2677	2311	2311
query76	2297	1146	808	808
query77	431	434	358	358
query78	12843	12965	12238	12238
query79	1468	1025	719	719
query80	1343	625	485	485
query81	522	277	241	241
query82	942	163	132	132
query83	365	277	250	250
query84	269	141	108	108
query85	908	507	443	443
query86	463	319	305	305
query87	3447	3346	3207	3207
query88	3617	2670	2646	2646
query89	455	392	353	353
query90	1932	189	182	182
query91	179	169	137	137
query92	77	81	69	69
query93	1206	972	575	575
query94	725	317	301	301
query95	663	459	342	342
query96	1098	774	321	321
query97	2674	2685	2563	2563
query98	237	226	223	223
query99	1111	1095	956	956
Total cold run time: 253869 ms
Total hot run time: 170170 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 85.48% (53/62) 🎉
Increment coverage report
Complete coverage report

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 80.56% (58/72) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17595	3862	3835	3835
q2	q3	10725	879	594	594
q4	4662	463	346	346
q5	7455	1326	1140	1140
q6	221	165	139	139
q7	923	954	764	764
q8	9738	1359	1327	1327
q9	6217	5411	5321	5321
q10	6341	2083	1818	1818
q11	475	266	248	248
q12	688	420	290	290
q13	18381	3292	2799	2799
q14	289	284	262	262
q15	q16	907	878	799	799
q17	989	1077	761	761
q18	6496	5712	5625	5625
q19	1349	1297	1086	1086
q20	512	411	265	265
q21	4951	2369	1940	1940
q22	484	387	328	328
Total cold run time: 99398 ms
Total hot run time: 29687 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4607	4501	4585	4501
q2	q3	4648	4768	4225	4225
q4	2118	2184	1398	1398
q5	5017	4994	5446	4994
q6	201	173	133	133
q7	2030	1843	1602	1602
q8	3335	3085	3139	3085
q9	8421	8635	8340	8340
q10	4511	4496	4242	4242
q11	605	404	405	404
q12	717	733	519	519
q13	3160	3596	2937	2937
q14	302	300	278	278
q15	q16	765	787	682	682
q17	1350	1333	1284	1284
q18	7919	7070	7056	7056
q19	1160	1162	1159	1159
q20	2271	2275	1973	1973
q21	6137	5401	4811	4811
q22	525	474	398	398
Total cold run time: 59799 ms
Total hot run time: 54021 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 170622 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 833fc19b502172dbf0d7961cd4aa6d3d1d36247d, data reload: false

query5	4332	646	503	503
query6	348	215	197	197
query7	4245	552	316	316
query8	330	225	215	215
query9	8797	4024	3982	3982
query10	456	341	301	301
query11	5770	2392	2207	2207
query12	182	136	128	128
query13	1278	584	451	451
query14	6340	5756	5046	5046
query14_1	4350	4373	4331	4331
query15	217	209	184	184
query16	1039	463	442	442
query17	1161	801	646	646
query18	2755	505	366	366
query19	226	218	171	171
query20	143	134	132	132
query21	225	142	120	120
query22	13605	13615	13389	13389
query23	17249	16431	16047	16047
query23_1	16191	16201	16110	16110
query24	7444	1743	1338	1338
query24_1	1323	1329	1337	1329
query25	587	483	449	449
query26	1304	325	170	170
query27	2677	592	331	331
query28	4379	1950	1987	1950
query29	1018	626	514	514
query30	309	234	200	200
query31	1134	1055	944	944
query32	85	76	73	73
query33	588	351	317	317
query34	1172	1153	644	644
query35	750	787	665	665
query36	1357	1316	1149	1149
query37	157	100	98	98
query38	3194	3133	3024	3024
query39	947	942	893	893
query39_1	867	878	879	878
query40	240	157	135	135
query41	66	64	61	61
query42	112	108	107	107
query43	332	323	277	277
query44	
query45	213	202	192	192
query46	1059	1137	713	713
query47	2346	2340	2197	2197
query48	402	406	288	288
query49	634	522	419	419
query50	705	294	212	212
query51	4290	4216	4180	4180
query52	103	102	93	93
query53	251	279	197	197
query54	318	276	247	247
query55	93	88	82	82
query56	292	300	297	297
query57	1402	1409	1319	1319
query58	302	261	266	261
query59	1588	1661	1433	1433
query60	343	328	320	320
query61	164	155	155	155
query62	718	615	555	555
query63	240	204	210	204
query64	2357	808	678	678
query65	
query66	1694	511	390	390
query67	30026	29332	29831	29332
query68	
query69	448	339	309	309
query70	1049	990	919	919
query71	298	274	266	266
query72	3152	2947	2615	2615
query73	895	757	434	434
query74	5092	4894	4729	4729
query75	2763	2648	2338	2338
query76	2287	1136	760	760
query77	418	430	347	347
query78	12918	12869	12455	12455
query79	1585	1010	755	755
query80	1383	572	511	511
query81	531	282	239	239
query82	924	162	125	125
query83	345	280	249	249
query84	261	151	110	110
query85	889	531	437	437
query86	479	329	339	329
query87	3413	3324	3204	3204
query88	3541	2661	2660	2660
query89	453	381	337	337
query90	1970	176	178	176
query91	177	169	137	137
query92	78	78	74	74
query93	1100	950	566	566
query94	754	348	283	283
query95	672	389	444	389
query96	1034	791	339	339
query97	2686	2708	2581	2581
query98	259	236	235	235
query99	1127	1099	983	983
Total cold run time: 254745 ms
Total hot run time: 170622 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 32.49% (64/197) 🎉
Increment coverage report
Complete coverage report

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17631	3849	3794	3794
q2	q3	10729	858	599	599
q4	4659	456	339	339
q5	7453	1307	1137	1137
q6	182	172	134	134
q7	903	955	724	724
q8	9309	1402	1232	1232
q9	5566	5364	5336	5336
q10	6311	2062	1809	1809
q11	469	278	252	252
q12	651	415	294	294
q13	18153	3506	2724	2724
q14	285	283	264	264
q15	q16	895	878	793	793
q17	994	1092	751	751
q18	6461	5625	5545	5545
q19	1215	1187	1051	1051
q20	509	408	275	275
q21	4579	2294	1919	1919
q22	465	390	325	325
Total cold run time: 97419 ms
Total hot run time: 29297 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4686	4515	4710	4515
q2	q3	4707	4770	4193	4193
q4	2078	2139	1364	1364
q5	4941	4995	5228	4995
q6	192	169	136	136
q7	2042	1841	1641	1641
q8	3327	3069	3051	3051
q9	8355	8496	8335	8335
q10	4513	4490	4235	4235
q11	581	428	393	393
q12	686	734	509	509
q13	3308	3578	2912	2912
q14	313	321	268	268
q15	q16	776	796	681	681
q17	1307	1297	1231	1231
q18	7802	6992	7003	6992
q19	1204	1146	1150	1146
q20	2260	2240	1983	1983
q21	6074	5319	4795	4795
q22	543	497	402	402
Total cold run time: 59695 ms
Total hot run time: 53777 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 168555 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 576ac17c2f9f56851b2490a00bee950cdcd436ff, data reload: false

query5	4331	644	516	516
query6	341	219	199	199
query7	4310	558	315	315
query8	316	232	211	211
query9	8836	3991	3974	3974
query10	493	337	289	289
query11	5799	2360	2200	2200
query12	178	132	125	125
query13	1282	620	424	424
query14	6020	5327	5031	5031
query14_1	4319	4299	4319	4299
query15	212	205	192	192
query16	1005	464	436	436
query17	1154	752	644	644
query18	2759	516	365	365
query19	224	212	173	173
query20	147	135	134	134
query21	220	145	117	117
query22	13542	13628	13396	13396
query23	17143	16293	15968	15968
query23_1	16105	16117	16080	16080
query24	7351	1799	1340	1340
query24_1	1402	1335	1353	1335
query25	557	510	433	433
query26	1293	306	173	173
query27	2726	559	334	334
query28	4405	1940	1933	1933
query29	983	633	501	501
query30	303	238	198	198
query31	1122	1071	938	938
query32	85	73	74	73
query33	553	343	285	285
query34	1160	1108	654	654
query35	771	770	655	655
query36	1305	1350	1143	1143
query37	148	105	91	91
query38	3232	3134	3076	3076
query39	937	929	929	929
query39_1	879	887	863	863
query40	242	156	134	134
query41	65	64	65	64
query42	108	115	109	109
query43	321	327	277	277
query44	
query45	212	198	192	192
query46	1107	1151	713	713
query47	2309	2301	2105	2105
query48	404	418	305	305
query49	640	543	418	418
query50	723	294	211	211
query51	4294	4275	4211	4211
query52	103	103	94	94
query53	252	278	205	205
query54	307	284	247	247
query55	97	96	89	89
query56	292	305	310	305
query57	1446	1454	1361	1361
query58	305	270	265	265
query59	1545	1663	1396	1396
query60	344	334	324	324
query61	162	148	155	148
query62	682	626	551	551
query63	252	203	220	203
query64	2481	820	668	668
query65	
query66	1711	515	395	395
query67	29902	29324	29090	29090
query68	
query69	453	338	301	301
query70	1016	997	993	993
query71	306	272	262	262
query72	2882	2696	2366	2366
query73	808	770	440	440
query74	5108	4870	4712	4712
query75	2744	2648	2318	2318
query76	2261	1140	755	755
query77	407	418	341	341
query78	12936	12883	12374	12374
query79	1491	1020	729	729
query80	680	570	493	493
query81	448	275	233	233
query82	1373	159	123	123
query83	358	281	246	246
query84	261	139	120	120
query85	854	505	446	446
query86	405	360	321	321
query87	3389	3355	3217	3217
query88	3602	2708	2702	2702
query89	439	379	335	335
query90	1885	177	180	177
query91	176	174	135	135
query92	78	73	76	73
query93	960	986	583	583
query94	535	349	291	291
query95	659	470	343	343
query96	1091	747	351	351
query97	2686	2675	2541	2541
query98	231	225	222	222
query99	1081	1139	961	961
Total cold run time: 252810 ms
Total hot run time: 168555 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 88.89% (64/72) 🎉
Increment coverage report
Complete coverage report

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17769	3851	3967	3851
q2	q3	10725	870	614	614
q4	4663	455	350	350
q5	7465	1315	1151	1151
q6	190	175	144	144
q7	915	931	746	746
q8	9288	1402	1290	1290
q9	5582	5369	5324	5324
q10	6299	2120	1793	1793
q11	470	269	261	261
q12	688	419	294	294
q13	18518	3222	2690	2690
q14	301	280	266	266
q15	q16	891	866	790	790
q17	1015	1128	688	688
q18	6374	5725	5567	5567
q19	1170	1209	1071	1071
q20	503	399	260	260
q21	4532	2258	1892	1892
q22	417	365	313	313
Total cold run time: 97775 ms
Total hot run time: 29355 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4254	4116	4123	4116
q2	q3	4626	4781	4187	4187
q4	2092	2150	1389	1389
q5	4966	4895	5110	4895
q6	188	164	132	132
q7	2070	1805	1766	1766
q8	3482	3207	3171	3171
q9	8496	8487	8503	8487
q10	4490	4518	4235	4235
q11	624	454	408	408
q12	679	792	528	528
q13	3248	3571	2986	2986
q14	305	315	274	274
q15	q16	748	763	697	697
q17	1363	1318	1278	1278
q18	8136	7203	7173	7173
q19	1146	1176	1162	1162
q20	2263	2251	1971	1971
q21	6175	5461	5014	5014
q22	538	503	436	436
Total cold run time: 59889 ms
Total hot run time: 54305 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

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

query5	4326	676	523	523
query6	339	218	199	199
query7	4270	586	299	299
query8	320	258	229	229
query9	8858	4014	4051	4014
query10	471	365	306	306
query11	6024	2429	2223	2223
query12	193	134	134	134
query13	1299	624	429	429
query14	6808	5379	5079	5079
query14_1	4357	4392	4386	4386
query15	216	206	187	187
query16	1045	468	451	451
query17	1154	796	651	651
query18	2768	505	376	376
query19	245	216	173	173
query20	142	131	136	131
query21	223	147	128	128
query22	13611	14007	14476	14007
query23	17413	16563	16139	16139
query23_1	16304	16219	16346	16219
query24	7668	1821	1350	1350
query24_1	1398	1350	1346	1346
query25	525	482	425	425
query26	1277	328	168	168
query27	2681	631	339	339
query28	4329	1993	1946	1946
query29	978	626	505	505
query30	306	237	192	192
query31	1143	1064	939	939
query32	81	70	69	69
query33	521	354	292	292
query34	1157	1135	643	643
query35	774	786	687	687
query36	1324	1367	1191	1191
query37	149	102	86	86
query38	3213	3134	3082	3082
query39	930	916	898	898
query39_1	879	857	863	857
query40	236	153	139	139
query41	67	64	60	60
query42	109	106	105	105
query43	326	329	283	283
query44	
query45	206	197	194	194
query46	1044	1199	743	743
query47	2318	2316	2147	2147
query48	399	417	328	328
query49	637	540	441	441
query50	741	297	216	216
query51	4279	4246	4190	4190
query52	111	106	93	93
query53	260	294	209	209
query54	338	275	274	274
query55	94	90	85	85
query56	301	304	311	304
query57	1411	1370	1336	1336
query58	291	270	266	266
query59	1583	1649	1404	1404
query60	342	338	322	322
query61	159	156	156	156
query62	670	619	560	560
query63	260	206	205	205
query64	2329	851	673	673
query65	
query66	1679	542	397	397
query67	30048	29899	29767	29767
query68	
query69	456	351	306	306
query70	1041	981	986	981
query71	311	284	277	277
query72	3030	2791	2423	2423
query73	834	757	390	390
query74	5079	4924	4754	4754
query75	2844	2663	2344	2344
query76	2292	1208	823	823
query77	420	430	358	358
query78	12792	13025	12385	12385
query79	1520	1021	766	766
query80	1392	591	481	481
query81	518	276	246	246
query82	1014	166	122	122
query83	334	281	244	244
query84	253	162	111	111
query85	897	525	452	452
query86	454	360	329	329
query87	3456	3359	3207	3207
query88	3635	2714	2669	2669
query89	458	374	337	337
query90	1986	185	184	184
query91	179	168	145	145
query92	82	79	73	73
query93	1167	953	564	564
query94	715	357	304	304
query95	668	490	351	351
query96	1046	776	314	314
query97	2736	2732	2552	2552
query98	243	235	224	224
query99	1112	1101	968	968
Total cold run time: 255723 ms
Total hot run time: 171694 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 80.56% (58/72) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 91.67% (66/72) 🎉
Increment coverage report
Complete coverage report

@englefly
Copy link
Copy Markdown
Contributor Author

run cloud_p0

@englefly
Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 75.00% (66/88) 🎉
Increment coverage report
Complete coverage report

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I found one additional issue beyond the existing review threads. The existing alias-removal compatibility concern in SessionVariable also still appears unresolved in the current diff, but I did not duplicate that inline comment.

Critical checkpoint conclusions:

  • Goal/test: the PR targets CTE empty-prune and cascading inline normalization, and adds focused regression coverage, but the implementation leaves optimizer CTE bookkeeping stale after mutating the rewrite plan.
  • Scope: the change is generally focused, but the new normalization hook needs to maintain existing StatementContext invariants.
  • Concurrency/lifecycle: no new concurrent execution path or special lifecycle issue found.
  • Config/compatibility: no new config is added; the removed cbo_cte_inline_mode alias is an existing user-visible compatibility issue already raised in a prior thread.
  • Parallel paths: CTE consumer/producer bookkeeping paths used by costing and runtime filter generation are not updated after this new normalization path.
  • Tests: regression tests cover plan-shape normalization, but they do not cover stale CTE consumer metadata effects on costing/runtime-filter decisions.
  • Observability/transactions/persistence: not applicable.
  • Performance: stale consumer counts can mis-cost remaining CTE producers/consumers and can suppress runtime-filter pushdown.

User focus: no additional user-provided review focus was supplied.

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: CTE normalization can remove empty branches or inline/remove anchors after StatementContext has already recorded producer and consumer metadata. Refresh the CTE context from the normalized rewrite plan before memo construction so CBO costing and runtime-filter pushdown use the live CTE shape.

### Release note

None

### Check List (For Author)

- Test: Unit Test

    - org.apache.doris.nereids.rules.rewrite.CTEInlineTest#refreshCteConsumersAfterNormalizeEliminatesEmptyBranch

    - Maven FE validate

- Behavior changed: No

- Does this need documentation: No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 84.04% (79/94) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17626	3935	3880	3880
q2	q3	10753	1381	827	827
q4	4686	467	343	343
q5	7668	2259	2082	2082
q6	238	172	137	137
q7	970	766	651	651
q8	9421	1692	1601	1601
q9	5134	4930	4909	4909
q10	6431	2141	1815	1815
q11	430	280	250	250
q12	636	421	291	291
q13	18155	3348	2811	2811
q14	266	258	237	237
q15	q16	824	773	704	704
q17	1022	872	898	872
q18	6961	5713	5575	5575
q19	1297	1320	1062	1062
q20	506	397	397	397
q21	6395	2897	2660	2660
q22	466	387	320	320
Total cold run time: 99885 ms
Total hot run time: 31424 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4764	4577	4555	4555
q2	q3	4802	5277	4776	4776
q4	2164	2221	1424	1424
q5	4784	4798	4676	4676
q6	229	176	130	130
q7	1821	1750	1518	1518
q8	2426	2085	2076	2076
q9	7745	7488	7270	7270
q10	4449	4373	3979	3979
q11	534	378	350	350
q12	710	721	510	510
q13	3039	3354	2794	2794
q14	277	279	261	261
q15	q16	683	688	637	637
q17	1260	1230	1222	1222
q18	7355	6898	6690	6690
q19	1140	1107	1124	1107
q20	2206	2250	1925	1925
q21	5320	4613	4503	4503
q22	534	484	432	432
Total cold run time: 56242 ms
Total hot run time: 50835 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

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

query5	4343	661	532	532
query6	335	215	201	201
query7	4254	589	291	291
query8	328	233	230	230
query9	8849	3945	3981	3945
query10	457	331	297	297
query11	5783	2372	2226	2226
query12	176	129	126	126
query13	1262	587	452	452
query14	6008	5369	5056	5056
query14_1	4349	4316	4334	4316
query15	210	197	188	188
query16	1020	469	415	415
query17	1115	723	573	573
query18	2444	480	347	347
query19	214	200	179	179
query20	137	131	131	131
query21	221	137	112	112
query22	13567	13576	13524	13524
query23	17277	16422	16102	16102
query23_1	16093	16130	16212	16130
query24	7564	1731	1260	1260
query24_1	1283	1264	1288	1264
query25	552	469	414	414
query26	1307	303	207	207
query27	2686	539	339	339
query28	4439	1927	1916	1916
query29	971	607	490	490
query30	306	244	201	201
query31	1128	1049	949	949
query32	95	82	70	70
query33	555	347	315	315
query34	1159	1125	628	628
query35	768	777	685	685
query36	1315	1339	1183	1183
query37	154	100	93	93
query38	3210	3140	3043	3043
query39	931	926	890	890
query39_1	881	882	878	878
query40	232	147	124	124
query41	67	63	63	63
query42	111	112	111	111
query43	316	326	291	291
query44	
query45	211	197	196	196
query46	1044	1177	734	734
query47	2289	2296	2211	2211
query48	414	423	303	303
query49	630	493	378	378
query50	1003	346	253	253
query51	4371	4352	4232	4232
query52	108	105	95	95
query53	258	283	205	205
query54	306	274	259	259
query55	93	94	85	85
query56	303	298	293	293
query57	1415	1392	1325	1325
query58	298	277	282	277
query59	1559	1653	1441	1441
query60	338	344	332	332
query61	186	176	179	176
query62	689	650	574	574
query63	251	199	211	199
query64	2497	854	683	683
query65	
query66	1748	493	368	368
query67	29921	29917	29852	29852
query68	
query69	468	348	317	317
query70	1039	982	987	982
query71	314	272	266	266
query72	3189	2658	1949	1949
query73	822	796	416	416
query74	5112	4880	4771	4771
query75	2658	2602	2252	2252
query76	2298	1120	773	773
query77	398	396	331	331
query78	12303	12124	11707	11707
query79	1522	1010	748	748
query80	647	538	437	437
query81	452	285	236	236
query82	1352	156	122	122
query83	365	276	242	242
query84	265	135	114	114
query85	928	516	442	442
query86	396	335	300	300
query87	3429	3402	3209	3209
query88	3533	2666	2639	2639
query89	443	388	337	337
query90	1948	181	178	178
query91	177	169	138	138
query92	80	74	69	69
query93	1503	1631	852	852
query94	544	333	327	327
query95	687	379	437	379
query96	1064	775	330	330
query97	2684	2693	2589	2589
query98	240	237	239	237
query99	1091	1109	993	993
Total cold run time: 253304 ms
Total hot run time: 169824 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 78.57% (88/112) 🎉
Increment coverage report
Complete coverage report

@englefly
Copy link
Copy Markdown
Contributor Author

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review conclusion: request changes. I did not add a duplicate inline comment because the remaining blocking issue is already covered by the existing thread on fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java: removing alias = "cbo_cte_inline_mode" is still present in the current PR diff and remains a user-visible compatibility break for existing SET cbo_cte_inline_mode = ... usage. Please keep the alias unless there is an intentional deprecation/migration plan.

Critical checkpoint conclusions:

  • Goal/test: The CTE normalization goal is addressed by fixpoint normalization and added FE/regression coverage for empty/cascading CTE pruning. The existing alias compatibility regression is unrelated to the stated optimizer fix and remains unaddressed.
  • Scope: The CTE changes are focused, but the session variable alias removal is not justified by the PR goal.
  • Concurrency/lifecycle: No new FE locking/concurrency or special lifecycle issue found in the reviewed CTE path.
  • Configuration/compatibility: Blocking issue remains for the removed legacy session-variable alias.
  • Parallel paths: Existing CTE context refresh paths were reviewed; no new distinct issue beyond prior threads found.
  • Tests/results: New CTE tests cover the main normalization behavior; I did not run tests in this review runner.
  • Observability/transactions/persistence/data writes: Not applicable to this PR.
  • Performance: No additional performance blocker found in the current CTE normalization logic.

User focus: no additional user-provided review focus was specified.

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants