Skip to content

Conversation

@morrySnow
Copy link
Contributor

What problem does this PR solve?

Related PR: #59600.

Problem Summary:

root cause: enforcer instance in lowest cost plan map not in enforcer set

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

intro by: apache#59600.
root cause: enforcer instance in lowest cost plan map not in enforcer set
@Thearas
Copy link
Contributor

Thearas commented Jan 20, 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?

@morrySnow morrySnow marked this pull request as ready for review January 20, 2026 10:52
@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17628	4208	4034	4034
q2	2067	347	233	233
q3	10152	1259	714	714
q4	10213	843	308	308
q5	7538	2062	1838	1838
q6	184	166	138	138
q7	928	763	647	647
q8	9267	1366	1116	1116
q9	4851	4557	4543	4543
q10	6758	1789	1363	1363
q11	524	306	301	301
q12	689	754	574	574
q13	17773	3814	3052	3052
q14	296	299	274	274
q15	582	501	514	501
q16	688	695	641	641
q17	664	786	521	521
q18	6601	6550	6668	6550
q19	1298	1112	657	657
q20	442	364	249	249
q21	3177	2590	2533	2533
q22	1173	1102	1030	1030
Total cold run time: 103493 ms
Total hot run time: 31817 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4275	4235	4290	4235
q2	339	415	329	329
q3	2344	2813	2480	2480
q4	1455	1916	1410	1410
q5	4505	4342	4237	4237
q6	227	171	132	132
q7	1985	1876	1750	1750
q8	2772	2357	2344	2344
q9	7199	7197	7135	7135
q10	2532	2828	2246	2246
q11	547	482	448	448
q12	750	765	566	566
q13	3371	3804	3085	3085
q14	274	275	258	258
q15	523	486	485	485
q16	605	642	600	600
q17	1084	1286	1261	1261
q18	7524	7302	7254	7254
q19	849	809	785	785
q20	1894	1977	1783	1783
q21	4506	4144	4148	4144
q22	1093	1054	965	965
Total cold run time: 50653 ms
Total hot run time: 47932 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 175178 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 56cbad7cf87d753bf864ca8eb3ff6750b294518b, data reload: false

query5	4412	643	476	476
query6	324	228	213	213
query7	4235	475	256	256
query8	335	240	237	237
query9	8710	2875	2875	2875
query10	483	382	325	325
query11	15527	15402	15088	15088
query12	176	117	114	114
query13	1258	470	387	387
query14	6120	3124	2772	2772
query14_1	2708	2673	2673	2673
query15	202	194	171	171
query16	977	487	463	463
query17	1062	662	539	539
query18	2489	434	333	333
query19	214	215	187	187
query20	119	116	117	116
query21	216	142	125	125
query22	3969	3982	3865	3865
query23	15824	15441	15288	15288
query23_1	15331	15513	15303	15303
query24	7205	1557	1180	1180
query24_1	1180	1167	1193	1167
query25	544	484	382	382
query26	1237	270	149	149
query27	2776	453	281	281
query28	4538	2167	2164	2164
query29	785	516	413	413
query30	322	249	219	219
query31	786	619	567	567
query32	82	74	74	74
query33	518	347	310	310
query34	887	913	544	544
query35	754	755	676	676
query36	895	820	794	794
query37	132	94	80	80
query38	2754	2762	2748	2748
query39	752	753	732	732
query39_1	700	709	701	701
query40	216	137	115	115
query41	68	62	60	60
query42	103	103	103	103
query43	472	440	414	414
query44	1347	752	760	752
query45	188	193	179	179
query46	834	965	577	577
query47	1407	1507	1384	1384
query48	310	322	242	242
query49	600	433	356	356
query50	619	288	212	212
query51	3837	3785	3875	3785
query52	104	108	100	100
query53	291	326	267	267
query54	296	260	306	260
query55	83	81	74	74
query56	310	302	305	302
query57	1020	1007	975	975
query58	272	260	265	260
query59	2138	2185	2078	2078
query60	330	365	314	314
query61	150	144	142	142
query62	387	361	327	327
query63	303	269	275	269
query64	4960	1220	948	948
query65	3868	3764	3769	3764
query66	1433	413	324	324
query67	15880	15859	15828	15828
query68	2402	1106	768	768
query69	439	376	336	336
query70	941	992	883	883
query71	330	326	290	290
query72	5430	3332	3463	3332
query73	615	739	326	326
query74	8692	8759	8477	8477
query75	2858	2866	2555	2555
query76	2277	1082	665	665
query77	372	389	307	307
query78	9957	10030	9217	9217
query79	1109	921	594	594
query80	1318	624	520	520
query81	562	283	264	264
query82	977	148	114	114
query83	334	269	252	252
query84	255	123	92	92
query85	966	484	425	425
query86	405	299	294	294
query87	2943	2885	2845	2845
query88	3515	2605	2555	2555
query89	390	353	334	334
query90	1955	177	168	168
query91	164	173	136	136
query92	78	77	70	70
query93	1124	908	540	540
query94	633	316	301	301
query95	580	329	313	313
query96	640	518	236	236
query97	2411	2409	2305	2305
query98	213	212	200	200
query99	597	592	539	539
Total cold run time: 248171 ms
Total hot run time: 175178 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.05
query2	0.10	0.05	0.05
query3	0.26	0.09	0.08
query4	1.62	0.11	0.11
query5	0.27	0.25	0.25
query6	1.14	0.68	0.64
query7	0.03	0.02	0.03
query8	0.06	0.04	0.04
query9	0.56	0.51	0.50
query10	0.56	0.55	0.55
query11	0.14	0.09	0.10
query12	0.15	0.10	0.12
query13	0.61	0.60	0.59
query14	0.94	0.94	0.94
query15	0.80	0.78	0.78
query16	0.39	0.40	0.42
query17	1.09	1.03	1.01
query18	0.23	0.22	0.21
query19	1.96	1.83	1.89
query20	0.02	0.02	0.01
query21	15.43	0.27	0.14
query22	5.23	0.06	0.04
query23	15.90	0.27	0.10
query24	1.04	0.23	0.48
query25	0.12	0.07	0.05
query26	0.15	0.13	0.13
query27	0.08	0.06	0.09
query28	3.84	1.07	0.88
query29	12.56	3.92	3.13
query30	0.28	0.13	0.12
query31	2.82	0.63	0.40
query32	3.28	0.55	0.45
query33	2.98	3.02	3.07
query34	16.32	5.07	4.40
query35	4.47	4.40	4.46
query36	0.64	0.51	0.49
query37	0.12	0.07	0.06
query38	0.07	0.05	0.03
query39	0.04	0.04	0.03
query40	0.17	0.14	0.13
query41	0.09	0.04	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 96.69 s
Total hot run time: 26.63 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 75.00% (3/4) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 75.00% (3/4) 🎉
Increment coverage report
Complete coverage report

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 75.00% (3/4) 🎉
Increment coverage report
Complete coverage report

&& rootGroup.getEnforcerSpecs().containsKey(
((PhysicalDistribute<?>) groupExpression.getPlan()).getDistributionSpec()))
|| rootGroup.getEnforcers().containsKey(groupExpression)) {
rootGroup.addChosenEnforcerId(groupExpression.getId().asInt());
Copy link
Contributor

Choose a reason for hiding this comment

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

The chosenEnforcerId may be wrong when explain memo plan print the group, the chosen groupExpression id is 1, but the group enforcers may not have groupExpression with id 1.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jan 21, 2026
@github-actions
Copy link
Contributor

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

@morrySnow morrySnow merged commit 866644b into apache:master Jan 21, 2026
32 of 35 checks passed
@morrySnow morrySnow deleted the fix_print_memo branch January 21, 2026 07:33
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.

6 participants