Skip to content

Conversation

@morrySnow
Copy link
Contributor

What problem does this PR solve?

related PR #58964

Problem Summary:

This pull request refactors how child physical plans are accessed in the ChildrenPropertiesRegulator class, simplifying the code and improving test clarity. The main change is the removal of the getChildPhysicalPlan helper method, replacing its usage with direct access to the plan from the children list. The tests are also updated to build child mocks more locally, improving test isolation and readability.

Refactoring and Simplification

  • Removed the getChildPhysicalPlan method from ChildrenPropertiesRegulator, and replaced its usage in visitPhysicalFilter and visitPhysicalProject with direct access to the child plan via children.get(0).getPlan(). This simplifies the code by eliminating unnecessary indirection. [1] [2] [3]

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
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?

@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17594	4172	4083	4083
q2	2056	361	240	240
q3	10143	1329	750	750
q4	10242	907	323	323
q5	7518	2238	1943	1943
q6	179	168	137	137
q7	1012	849	727	727
q8	9360	1462	1248	1248
q9	6997	5346	5328	5328
q10	6809	2398	1972	1972
q11	533	338	312	312
q12	683	722	580	580
q13	17752	3700	3028	3028
q14	291	302	286	286
q15	597	518	513	513
q16	710	681	633	633
q17	691	832	609	609
q18	7351	7702	7855	7702
q19	952	998	688	688
q20	442	406	255	255
q21	4544	4446	4134	4134
q22	1183	1066	1023	1023
Total cold run time: 107639 ms
Total hot run time: 36514 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4328	4224	4379	4224
q2	346	426	320	320
q3	2357	2775	2455	2455
q4	1393	1840	1394	1394
q5	4548	4622	4433	4433
q6	215	170	123	123
q7	2031	1954	1787	1787
q8	2730	2549	2666	2549
q9	7471	7496	7440	7440
q10	3132	3246	2814	2814
q11	611	523	495	495
q12	640	677	599	599
q13	3314	3663	3053	3053
q14	268	288	257	257
q15	528	500	481	481
q16	626	660	590	590
q17	1127	1303	1288	1288
q18	7449	7010	6958	6958
q19	862	796	849	796
q20	1916	1984	1787	1787
q21	4566	4278	4422	4278
q22	1074	1025	966	966
Total cold run time: 51532 ms
Total hot run time: 49087 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 179688 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 1fb7c9a9a9d8b3ee69894f455f40a4a95c9aae9c, data reload: false

query5	4410	595	482	482
query6	329	234	234	234
query7	4215	459	271	271
query8	313	247	271	247
query9	8743	2565	2537	2537
query10	505	385	324	324
query11	15735	15033	14749	14749
query12	171	122	125	122
query13	1265	520	395	395
query14	5518	3002	2879	2879
query14_1	2688	2644	2674	2644
query15	219	196	185	185
query16	910	489	459	459
query17	970	729	606	606
query18	2437	447	346	346
query19	233	231	220	220
query20	120	117	117	117
query21	228	139	119	119
query22	3821	4108	3946	3946
query23	16588	16241	15922	15922
query23_1	16191	16146	15964	15964
query24	7381	1686	1253	1253
query24_1	1279	1215	1248	1215
query25	591	499	456	456
query26	1238	280	166	166
query27	2742	469	309	309
query28	4481	2144	2141	2141
query29	830	566	492	492
query30	323	245	223	223
query31	804	695	646	646
query32	85	76	71	71
query33	589	326	283	283
query34	916	925	525	525
query35	765	786	708	708
query36	845	924	822	822
query37	130	88	80	80
query38	3066	3037	2962	2962
query39	751	775	751	751
query39_1	714	697	703	697
query40	224	146	119	119
query41	67	63	63	63
query42	108	103	103	103
query43	428	423	410	410
query44	1305	753	733	733
query45	190	190	181	181
query46	875	964	611	611
query47	1664	1700	1633	1633
query48	335	336	243	243
query49	625	423	354	354
query50	662	300	219	219
query51	3838	3857	3779	3779
query52	113	111	97	97
query53	321	349	299	299
query54	290	269	275	269
query55	80	78	73	73
query56	295	290	299	290
query57	1165	1151	1075	1075
query58	274	262	280	262
query59	2378	2522	2349	2349
query60	315	325	283	283
query61	166	158	168	158
query62	756	720	675	675
query63	326	297	299	297
query64	5031	1302	1006	1006
query65	4020	3958	3954	3954
query66	1484	436	312	312
query67	15287	14910	14940	14910
query68	8345	988	716	716
query69	504	350	317	317
query70	1095	1027	998	998
query71	355	314	278	278
query72	6077	5043	5232	5043
query73	727	682	308	308
query74	8726	8960	8836	8836
query75	3193	3164	2795	2795
query76	3851	1133	745	745
query77	522	403	296	296
query78	9390	9492	8851	8851
query79	1396	866	618	618
query80	698	651	574	574
query81	495	270	231	231
query82	218	133	104	104
query83	278	253	239	239
query84	302	125	111	111
query85	921	503	470	470
query86	336	308	278	278
query87	3156	3413	3190	3190
query88	3618	2278	2279	2278
query89	469	421	398	398
query90	2248	163	157	157
query91	173	163	144	144
query92	92	74	64	64
query93	1247	941	552	552
query94	495	306	281	281
query95	573	335	304	304
query96	584	474	207	207
query97	2234	2315	2258	2258
query98	227	203	190	190
query99	1323	1474	1281	1281
Total cold run time: 259815 ms
Total hot run time: 179688 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.05
query2	0.09	0.05	0.05
query3	0.26	0.10	0.09
query4	1.61	0.11	0.11
query5	0.28	0.25	0.25
query6	1.16	0.67	0.64
query7	0.04	0.03	0.03
query8	0.06	0.04	0.04
query9	0.56	0.50	0.49
query10	0.55	0.56	0.54
query11	0.15	0.11	0.12
query12	0.14	0.11	0.12
query13	0.64	0.60	0.61
query14	0.99	0.98	0.99
query15	0.81	0.79	0.80
query16	0.43	0.39	0.40
query17	0.99	0.97	1.06
query18	0.24	0.21	0.21
query19	1.89	1.87	1.90
query20	0.02	0.01	0.01
query21	15.46	0.27	0.13
query22	4.66	0.05	0.04
query23	15.92	0.28	0.10
query24	1.59	0.70	0.28
query25	0.07	0.07	0.08
query26	0.15	0.13	0.13
query27	0.10	0.04	0.05
query28	4.91	1.21	1.03
query29	12.65	4.01	3.17
query30	0.27	0.14	0.12
query31	2.82	0.63	0.38
query32	3.24	0.55	0.45
query33	3.00	3.00	3.00
query34	16.76	5.27	4.51
query35	4.53	4.65	4.53
query36	0.66	0.49	0.48
query37	0.10	0.07	0.06
query38	0.08	0.04	0.04
query39	0.05	0.03	0.03
query40	0.16	0.14	0.13
query41	0.09	0.03	0.03
query42	0.05	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 98.32 s
Total hot run time: 27.14 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Dec 29, 2025
@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.

Copy link
Contributor

@yujun777 yujun777 left a comment

Choose a reason for hiding this comment

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

LGTM

@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17620	4214	4055	4055
q2	2056	378	238	238
q3	10121	1292	766	766
q4	10209	870	311	311
q5	7516	2115	1853	1853
q6	195	179	138	138
q7	917	795	664	664
q8	9285	1380	1099	1099
q9	6780	5179	5136	5136
q10	6749	1785	1410	1410
q11	500	294	278	278
q12	667	723	588	588
q13	17769	3822	3040	3040
q14	291	290	278	278
q15	593	511	503	503
q16	681	666	630	630
q17	709	733	609	609
q18	7555	7261	7121	7121
q19	1139	976	584	584
q20	403	361	241	241
q21	4164	4001	3407	3407
q22	1069	1021	980	980
Total cold run time: 106988 ms
Total hot run time: 33929 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4095	4035	4032	4032
q2	324	404	331	331
q3	2053	2601	2264	2264
q4	1334	1721	1300	1300
q5	4036	3995	4615	3995
q6	219	180	137	137
q7	2113	1986	1830	1830
q8	2568	2380	2269	2269
q9	7122	7164	7170	7164
q10	2535	2755	2291	2291
q11	539	465	445	445
q12	725	738	603	603
q13	3814	4168	3481	3481
q14	283	285	273	273
q15	545	523	503	503
q16	673	721	649	649
q17	1097	1346	1449	1346
q18	7904	7987	7741	7741
q19	892	867	864	864
q20	1985	2054	1946	1946
q21	4650	4297	4052	4052
q22	1072	1039	1000	1000
Total cold run time: 50578 ms
Total hot run time: 48516 ms

@doris-robot
Copy link

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

query5	4803	595	429	429
query6	332	227	228	227
query7	4216	490	285	285
query8	345	265	243	243
query9	8807	2638	2627	2627
query10	538	374	337	337
query11	15674	15344	14894	14894
query12	179	123	124	123
query13	1267	512	386	386
query14	6327	3025	2775	2775
query14_1	2635	2589	2627	2589
query15	197	194	176	176
query16	980	481	469	469
query17	1047	685	564	564
query18	2582	444	339	339
query19	219	217	187	187
query20	129	124	121	121
query21	213	144	128	128
query22	4060	3824	4101	3824
query23	15970	15592	15117	15117
query23_1	15222	15318	15280	15280
query24	7358	1613	1225	1225
query24_1	1229	1211	1264	1211
query25	544	444	401	401
query26	1240	267	167	167
query27	2769	473	297	297
query28	4555	2178	2171	2171
query29	758	531	436	436
query30	317	242	221	221
query31	810	628	550	550
query32	78	70	65	65
query33	529	338	286	286
query34	896	897	545	545
query35	748	786	694	694
query36	825	887	823	823
query37	135	92	77	77
query38	2750	2743	2702	2702
query39	763	747	745	745
query39_1	711	707	720	707
query40	217	140	120	120
query41	69	64	65	64
query42	104	103	102	102
query43	483	480	398	398
query44	1359	761	754	754
query45	195	186	179	179
query46	867	1009	621	621
query47	1434	1472	1287	1287
query48	306	321	243	243
query49	608	411	334	334
query50	655	281	214	214
query51	3897	3829	3909	3829
query52	103	111	106	106
query53	298	330	267	267
query54	292	259	248	248
query55	74	77	71	71
query56	285	291	287	287
query57	995	941	889	889
query58	273	255	263	255
query59	2037	2196	2061	2061
query60	326	327	302	302
query61	170	158	165	158
query62	391	372	316	316
query63	297	266	275	266
query64	4905	1322	1143	1143
query65	3900	3669	3774	3669
query66	1445	468	335	335
query67	14807	14849	14697	14697
query68	2824	1058	764	764
query69	461	362	324	324
query70	954	905	849	849
query71	314	318	284	284
query72	6419	5034	4982	4982
query73	539	631	315	315
query74	8778	8795	8510	8510
query75	2898	2932	2529	2529
query76	2879	1054	655	655
query77	346	370	280	280
query78	10003	10020	9236	9236
query79	1086	941	603	603
query80	1206	604	495	495
query81	548	279	245	245
query82	994	149	108	108
query83	369	264	242	242
query84	256	125	100	100
query85	929	509	475	475
query86	481	301	289	289
query87	2894	2972	2742	2742
query88	3287	2237	2269	2237
query89	390	347	335	335
query90	1988	153	149	149
query91	178	167	144	144
query92	69	64	64	64
query93	983	904	563	563
query94	634	317	304	304
query95	582	327	308	308
query96	585	463	207	207
query97	2387	2420	2307	2307
query98	229	207	197	197
query99	566	588	492	492
Total cold run time: 250549 ms
Total hot run time: 174590 ms

@doris-robot
Copy link

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

query1	0.06	0.04	0.04
query2	0.11	0.05	0.05
query3	0.26	0.08	0.09
query4	1.61	0.11	0.10
query5	0.28	0.26	0.27
query6	1.15	0.66	0.66
query7	0.03	0.02	0.02
query8	0.06	0.04	0.04
query9	0.56	0.51	0.50
query10	0.54	0.53	0.54
query11	0.16	0.11	0.11
query12	0.16	0.12	0.13
query13	0.61	0.60	0.60
query14	0.99	1.00	1.00
query15	0.81	0.81	0.80
query16	0.38	0.39	0.39
query17	0.98	1.04	1.01
query18	0.23	0.22	0.21
query19	1.95	1.90	1.89
query20	0.02	0.01	0.01
query21	15.43	0.28	0.14
query22	4.97	0.05	0.04
query23	16.11	0.29	0.11
query24	1.11	0.69	0.19
query25	0.11	0.10	0.06
query26	0.16	0.13	0.13
query27	0.06	0.08	0.05
query28	4.24	1.05	0.89
query29	12.59	3.94	3.14
query30	0.28	0.14	0.11
query31	2.81	0.62	0.38
query32	3.23	0.56	0.47
query33	3.03	3.02	2.98
query34	16.38	5.11	4.40
query35	4.42	4.46	4.45
query36	0.65	0.51	0.49
query37	0.10	0.06	0.06
query38	0.07	0.04	0.04
query39	0.05	0.03	0.03
query40	0.16	0.15	0.14
query41	0.10	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 97.09 s
Total hot run time: 26.81 s

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

@morrySnow morrySnow closed this Dec 31, 2025
@morrySnow morrySnow reopened this Dec 31, 2025
@morrySnow morrySnow merged commit 28b2d23 into apache:master Dec 31, 2025
38 of 39 checks passed
@morrySnow morrySnow deleted the simple_get_children branch December 31, 2025 03:56
github-actions bot pushed a commit that referenced this pull request Dec 31, 2025
related PR #58964

Problem Summary:

This pull request refactors how child physical plans are accessed in the
`ChildrenPropertiesRegulator` class, simplifying the code and improving
test clarity. The main change is the removal of the
`getChildPhysicalPlan` helper method, replacing its usage with direct
access to the plan from the `children` list. The tests are also updated
to build child mocks more locally, improving test isolation and
readability.

Refactoring and Simplification:

* Removed the `getChildPhysicalPlan` method from
`ChildrenPropertiesRegulator`, and replaced its usage in
`visitPhysicalFilter` and `visitPhysicalProject` with direct access to
the child plan via `children.get(0).getPlan()`. This simplifies the code
by eliminating unnecessary indirection.
yiguolei pushed a commit that referenced this pull request Jan 5, 2026
…ulator #59395 (#59505)

Cherry-picked from #59395

Co-authored-by: morrySnow <zhangwenxin@selectdb.com>
@yiguolei yiguolei removed the dev/4.0.x label Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.0.3-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants