Skip to content

[fix](mtmv) Eliminate redundant filters in nested MV candidate definitions - #63639

Merged
yujun777 merged 4 commits into
apache:masterfrom
foxtail463:fix/nested-mv-relation-implied-predicates
Oct 21, 2026
Merged

yujun777 merged 4 commits into
apache:masterfrom
foxtail463:fix/nested-mv-relation-implied-predicates

Conversation

@foxtail463

@foxtail463 foxtail463 commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem Summary:

Nested MV rewriting can fail when an upper MV repeats a filter that is already guaranteed by its lower MV.

For example:

mv_fact_snapshot_v1:
SELECT k1, dim_id, sku_type, amount
FROM fact
WHERE sku_type = '1';
mv_detail_trade_joined_v1:
SELECT t.k1, t.dim_id, t.sku_type, t.amount, d.tag
FROM mv_fact_snapshot_v1 t
JOIN dim d ON t.dim_id = d.dim_id
WHERE t.sku_type = '1';

For the query:

SELECT f.k1, f.dim_id, f.sku_type, f.amount, d.tag
FROM fact f
JOIN dim d ON f.dim_id = d.dim_id
WHERE f.sku_type = '1';

The query can match mv_fact_snapshot_v1, but matching mv_detail_trade_joined_v1 may be rejected because of the repeated t.sku_type = '1' filter. However, mv_fact_snapshot_v1 already guarantees that every output row satisfies this predicate, so the upper-MV filter is redundant.

Solution:

Use reliable predicates guaranteed by the lower MV to prove redundant filters in upper-MV definitions during candidate matching. This allows nested rewriting to match mv_detail_trade_joined_v1 without requiring the upper MV to expose additional filter columns.

Query predicates must still be preserved for compensation. Cached MV definitions remain unchanged. Output-predicate guarantees are withheld whenever the MV definition or refresh state cannot reliably establish them.

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

@foxtail463

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 31635 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit d81c332bbee00191472d0fba81eb25272f6942a8, 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	17673	4095	4046	4046
q2	q3	10815	1381	822	822
q4	4685	468	356	356
q5	7566	2249	2095	2095
q6	236	173	138	138
q7	976	762	642	642
q8	9432	1760	1669	1669
q9	5245	5028	4972	4972
q10	6399	2216	1884	1884
q11	457	274	244	244
q12	631	429	297	297
q13	18114	3386	2802	2802
q14	268	264	235	235
q15	q16	818	783	714	714
q17	952	959	1052	959
q18	6992	5726	5600	5600
q19	1303	1329	1149	1149
q20	536	384	258	258
q21	5986	2607	2455	2455
q22	434	365	298	298
Total cold run time: 99518 ms
Total hot run time: 31635 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	4319	4274	4272	4272
q2	q3	4558	4984	4321	4321
q4	2107	2240	1414	1414
q5	4486	4329	4333	4329
q6	335	248	165	165
q7	2120	2021	1697	1697
q8	2558	2238	2208	2208
q9	8365	8038	8117	8038
q10	4853	4755	4312	4312
q11	580	438	402	402
q12	762	760	546	546
q13	3290	3670	3009	3009
q14	297	306	279	279
q15	q16	720	739	630	630
q17	1368	1490	1325	1325
q18	7809	7390	7386	7386
q19	1108	1072	1127	1072
q20	2215	2197	1940	1940
q21	5315	4610	4544	4544
q22	533	453	406	406
Total cold run time: 57698 ms
Total hot run time: 52295 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 171215 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 d81c332bbee00191472d0fba81eb25272f6942a8, data reload: false

query5	4348	665	538	538
query6	324	214	198	198
query7	4305	565	311	311
query8	322	228	210	210
query9	8845	4046	4036	4036
query10	449	338	288	288
query11	5767	2438	2262	2262
query12	184	128	122	122
query13	1276	615	436	436
query14	6157	5536	5212	5212
query14_1	4522	4465	4460	4460
query15	211	202	185	185
query16	995	463	413	413
query17	1110	702	574	574
query18	2456	474	347	347
query19	211	205	158	158
query20	135	130	129	129
query21	214	136	118	118
query22	13687	13594	13339	13339
query23	17219	16674	16226	16226
query23_1	16329	16438	16232	16232
query24	7506	1756	1317	1317
query24_1	1342	1281	1321	1281
query25	548	486	401	401
query26	1302	328	175	175
query27	2701	560	337	337
query28	4405	2007	1977	1977
query29	996	628	523	523
query30	310	245	202	202
query31	1116	1088	969	969
query32	92	79	73	73
query33	573	355	284	284
query34	1177	1134	635	635
query35	779	786	687	687
query36	1409	1440	1260	1260
query37	150	103	89	89
query38	3227	3148	3084	3084
query39	939	918	899	899
query39_1	861	864	888	864
query40	227	140	120	120
query41	64	62	61	61
query42	109	107	108	107
query43	327	342	301	301
query44	
query45	212	208	199	199
query46	1080	1196	728	728
query47	2375	2464	2281	2281
query48	406	390	300	300
query49	635	495	378	378
query50	974	337	251	251
query51	4380	4344	4218	4218
query52	105	106	93	93
query53	244	274	202	202
query54	299	279	253	253
query55	92	86	85	85
query56	302	293	303	293
query57	1467	1448	1357	1357
query58	285	274	258	258
query59	1629	1723	1458	1458
query60	313	323	306	306
query61	159	156	158	156
query62	701	650	586	586
query63	243	200	203	200
query64	2372	815	640	640
query65	
query66	1723	472	355	355
query67	29749	29534	29448	29448
query68	
query69	454	340	306	306
query70	1025	1034	955	955
query71	305	271	271	271
query72	3037	2698	2440	2440
query73	813	753	408	408
query74	5099	4916	4752	4752
query75	2693	2650	2286	2286
query76	2288	1143	777	777
query77	401	416	354	354
query78	12281	12380	11791	11791
query79	1263	1100	773	773
query80	592	559	490	490
query81	456	279	246	246
query82	235	169	123	123
query83	288	289	258	258
query84	266	146	118	118
query85	968	617	525	525
query86	355	332	327	327
query87	3464	3387	3235	3235
query88	3597	2735	2753	2735
query89	431	393	349	349
query90	2164	181	184	181
query91	191	188	158	158
query92	119	76	68	68
query93	1444	1371	835	835
query94	541	336	314	314
query95	695	395	438	395
query96	1107	816	354	354
query97	2728	2756	2592	2592
query98	242	228	227	227
query99	1201	1179	1023	1023
Total cold run time: 252194 ms
Total hot run time: 171215 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 75.24% (310/412) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 77.43% (319/412) 🎉
Increment coverage report
Complete coverage report

@foxtail463

Copy link
Copy Markdown
Contributor Author

run cloud_p0
run p0

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 76.87% (319/415) 🎉
Increment coverage report
Complete coverage report

@foxtail463
foxtail463 force-pushed the fix/nested-mv-relation-implied-predicates branch from d81c332 to f6264f3 Compare May 26, 2026 07:32
@foxtail463

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 31602 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit f6264f3e27cad5f9c5ca5b3900d22b28362fadea, 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	17597	4030	3981	3981
q2	q3	10818	1394	811	811
q4	4683	482	351	351
q5	7623	2236	2193	2193
q6	243	183	139	139
q7	919	793	643	643
q8	9391	1827	1644	1644
q9	5201	4974	4962	4962
q10	6417	2177	1845	1845
q11	435	270	248	248
q12	633	430	300	300
q13	18132	3404	2749	2749
q14	262	259	241	241
q15	q16	820	769	710	710
q17	990	920	996	920
q18	6885	5765	5572	5572
q19	1315	1307	999	999
q20	650	476	283	283
q21	6114	2877	2624	2624
q22	471	387	434	387
Total cold run time: 99599 ms
Total hot run time: 31602 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	4896	4859	4778	4778
q2	q3	5022	5451	4692	4692
q4	2158	2240	1426	1426
q5	4989	4831	4674	4674
q6	236	176	129	129
q7	1994	1761	1551	1551
q8	2476	2117	2171	2117
q9	8031	7528	7398	7398
q10	4743	4686	4241	4241
q11	530	381	363	363
q12	759	748	547	547
q13	3100	3368	2808	2808
q14	282	270	254	254
q15	q16	676	703	607	607
q17	1304	1271	1294	1271
q18	7268	6771	6943	6771
q19	1162	1081	1102	1081
q20	2255	2237	1941	1941
q21	5400	4716	4622	4622
q22	515	495	417	417
Total cold run time: 57796 ms
Total hot run time: 51688 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 173393 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 f6264f3e27cad5f9c5ca5b3900d22b28362fadea, data reload: false

query5	4320	657	529	529
query6	327	209	193	193
query7	4284	542	310	310
query8	321	235	227	227
query9	8867	4192	4226	4192
query10	448	344	297	297
query11	5778	2409	2258	2258
query12	187	132	124	124
query13	1276	600	484	484
query14	6239	5550	5264	5264
query14_1	4555	4564	4540	4540
query15	223	212	188	188
query16	1008	472	476	472
query17	1160	757	615	615
query18	2472	513	370	370
query19	226	207	169	169
query20	142	134	130	130
query21	216	139	117	117
query22	13604	13596	13393	13393
query23	17486	16550	16343	16343
query23_1	16490	16404	16491	16404
query24	7421	1801	1349	1349
query24_1	1321	1356	1335	1335
query25	594	476	424	424
query26	1322	339	169	169
query27	2644	579	342	342
query28	4435	2083	2046	2046
query29	994	625	499	499
query30	307	243	199	199
query31	1139	1077	968	968
query32	90	78	73	73
query33	526	350	281	281
query34	1211	1151	668	668
query35	783	812	708	708
query36	1441	1416	1265	1265
query37	157	103	90	90
query38	3217	3202	3112	3112
query39	923	948	907	907
query39_1	864	869	891	869
query40	228	146	123	123
query41	69	65	68	65
query42	109	110	109	109
query43	330	335	292	292
query44	
query45	214	203	195	195
query46	1160	1213	787	787
query47	2396	2372	2222	2222
query48	415	399	293	293
query49	630	496	381	381
query50	987	339	255	255
query51	4332	4376	4242	4242
query52	106	109	93	93
query53	247	284	213	213
query54	314	269	248	248
query55	94	94	86	86
query56	308	313	306	306
query57	1438	1416	1357	1357
query58	306	271	271	271
query59	1573	1671	1420	1420
query60	318	321	313	313
query61	160	151	153	151
query62	704	668	597	597
query63	242	202	205	202
query64	2413	803	639	639
query65	
query66	1732	482	368	368
query67	29738	29676	29560	29560
query68	
query69	467	335	311	311
query70	974	1021	1028	1021
query71	306	281	270	270
query72	3013	2697	2757	2697
query73	842	745	444	444
query74	5218	4979	4817	4817
query75	2739	2651	2315	2315
query76	2285	1159	784	784
query77	419	422	356	356
query78	12547	12518	11977	11977
query79	1421	1021	752	752
query80	648	539	454	454
query81	463	284	246	246
query82	1391	155	121	121
query83	371	276	254	254
query84	260	146	113	113
query85	877	559	453	453
query86	407	325	318	318
query87	3438	3379	3247	3247
query88	3685	2797	2784	2784
query89	442	394	344	344
query90	1960	178	172	172
query91	180	167	137	137
query92	79	77	75	75
query93	1528	1504	874	874
query94	539	353	313	313
query95	681	389	346	346
query96	1017	767	342	342
query97	2749	2736	2580	2580
query98	238	230	223	223
query99	1194	1166	1022	1022
Total cold run time: 254954 ms
Total hot run time: 173393 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 74.47% (315/423) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 65.21% (328/503) 🎉
Increment coverage report
Complete coverage report

@foxtail463
foxtail463 force-pushed the fix/nested-mv-relation-implied-predicates branch from f6264f3 to ad3c922 Compare June 4, 2026 07:24
@foxtail463
foxtail463 force-pushed the fix/nested-mv-relation-implied-predicates branch from ad3c922 to 08a03f1 Compare June 15, 2026 10:11
@foxtail463

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 73.96% (125/169) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28962 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 08a03f1d590b16c4ea5480f5950ed44ec8d8c447, 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	17721	3982	3969	3969
q2	q3	10871	1426	799	799
q4	4684	485	347	347
q5	7546	883	582	582
q6	177	173	136	136
q7	797	823	646	646
q8	9346	1572	1609	1572
q9	6556	4572	4508	4508
q10	6807	1827	1506	1506
q11	439	280	248	248
q12	640	423	290	290
q13	18090	3621	2807	2807
q14	265	260	253	253
q15	q16	820	792	706	706
q17	1017	903	1064	903
q18	7068	5865	5573	5573
q19	1322	1353	1117	1117
q20	530	406	278	278
q21	6007	2582	2417	2417
q22	434	356	305	305
Total cold run time: 101137 ms
Total hot run time: 28962 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	4381	4315	4265	4265
q2	q3	4556	4990	4341	4341
q4	2123	2243	1399	1399
q5	4524	4374	4327	4327
q6	237	173	129	129
q7	1751	2025	1823	1823
q8	2581	2274	2206	2206
q9	8139	8303	8091	8091
q10	4818	4989	4316	4316
q11	587	404	369	369
q12	788	760	535	535
q13	3303	3666	3062	3062
q14	309	294	260	260
q15	q16	697	778	652	652
q17	1374	1333	1488	1333
q18	7969	7302	7298	7298
q19	1186	1094	1131	1094
q20	2218	2223	1944	1944
q21	5311	4648	4501	4501
q22	513	446	401	401
Total cold run time: 57365 ms
Total hot run time: 52346 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 168704 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 08a03f1d590b16c4ea5480f5950ed44ec8d8c447, data reload: false

query5	4344	626	486	486
query6	440	195	189	189
query7	4855	551	296	296
query8	375	224	208	208
query9	8762	4030	4031	4030
query10	459	322	270	270
query11	5927	2368	2187	2187
query12	163	103	98	98
query13	1286	607	432	432
query14	6393	5437	5114	5114
query14_1	4386	4401	4424	4401
query15	204	201	179	179
query16	1031	462	444	444
query17	1130	712	580	580
query18	2725	478	359	359
query19	213	183	142	142
query20	120	108	107	107
query21	220	139	120	120
query22	13603	13582	13434	13434
query23	17371	16486	16248	16248
query23_1	16273	16270	16302	16270
query24	7432	1767	1265	1265
query24_1	1317	1276	1320	1276
query25	561	474	412	412
query26	1293	314	181	181
query27	2592	567	333	333
query28	4414	2030	2042	2030
query29	1088	641	505	505
query30	299	229	197	197
query31	1127	1077	968	968
query32	110	69	60	60
query33	521	339	302	302
query34	1151	1166	653	653
query35	743	779	693	693
query36	1376	1435	1241	1241
query37	150	101	85	85
query38	3198	3145	3057	3057
query39	935	928	896	896
query39_1	872	892	867	867
query40	218	120	97	97
query41	64	62	59	59
query42	92	90	98	90
query43	327	321	279	279
query44	
query45	198	185	177	177
query46	1110	1186	703	703
query47	2406	2428	2235	2235
query48	390	399	293	293
query49	617	460	349	349
query50	931	362	274	274
query51	4397	4406	4278	4278
query52	89	89	77	77
query53	243	270	192	192
query54	254	214	190	190
query55	77	76	69	69
query56	241	233	213	213
query57	1429	1420	1315	1315
query58	236	229	209	209
query59	1599	1687	1449	1449
query60	298	250	229	229
query61	141	148	148	148
query62	690	657	596	596
query63	224	182	185	182
query64	2529	775	599	599
query65	
query66	1764	458	383	383
query67	29767	29029	29593	29029
query68	
query69	424	310	264	264
query70	996	919	928	919
query71	291	219	209	209
query72	2949	2688	2428	2428
query73	828	734	445	445
query74	5107	4972	4743	4743
query75	2655	2580	2248	2248
query76	2303	1154	770	770
query77	352	373	276	276
query78	12449	12516	11840	11840
query79	1419	1065	762	762
query80	582	481	375	375
query81	453	280	239	239
query82	563	158	121	121
query83	360	280	247	247
query84	
query85	847	502	430	430
query86	361	302	291	291
query87	3388	3380	3153	3153
query88	3613	2740	2722	2722
query89	429	383	326	326
query90	2011	183	174	174
query91	172	165	134	134
query92	63	60	57	57
query93	1493	1515	961	961
query94	571	354	317	317
query95	701	371	347	347
query96	1116	821	320	320
query97	2683	2690	2576	2576
query98	224	211	202	202
query99	1157	1171	1017	1017
Total cold run time: 250685 ms
Total hot run time: 168704 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 12.99% (137/1055) 🎉
Increment coverage report
Complete coverage report

@foxtail463
foxtail463 force-pushed the fix/nested-mv-relation-implied-predicates branch from 08a03f1 to 11a1303 Compare June 15, 2026 19:15
@foxtail463
foxtail463 requested a review from seawinde as a code owner June 15, 2026 19:15
@foxtail463

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28683 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 11a1303ab816324ae53fb833fc57895821229171, 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	17698	4120	4060	4060
q2	q3	10780	1381	779	779
q4	4686	470	348	348
q5	7519	860	583	583
q6	186	170	140	140
q7	764	839	612	612
q8	9848	1585	1512	1512
q9	6955	4475	4494	4475
q10	6850	1797	1474	1474
q11	439	267	243	243
q12	659	416	289	289
q13	18197	3350	2762	2762
q14	270	256	247	247
q15	q16	818	789	706	706
q17	977	877	980	877
q18	6848	5813	5450	5450
q19	1431	1382	1119	1119
q20	511	397	257	257
q21	5635	2721	2453	2453
q22	440	355	297	297
Total cold run time: 101511 ms
Total hot run time: 28683 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	4466	4302	4316	4302
q2	q3	4509	4927	4320	4320
q4	2063	2206	1356	1356
q5	4491	4301	4305	4301
q6	230	174	129	129
q7	1707	1870	1650	1650
q8	2535	2197	2271	2197
q9	7966	7911	7935	7911
q10	4840	4753	4288	4288
q11	559	404	531	404
q12	746	746	529	529
q13	3251	3645	3007	3007
q14	316	310	292	292
q15	q16	735	741	660	660
q17	1368	1322	1331	1322
q18	7888	7420	6798	6798
q19	1073	1085	1107	1085
q20	2220	2215	1963	1963
q21	5211	4524	4374	4374
q22	511	447	406	406
Total cold run time: 56685 ms
Total hot run time: 51294 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 152163 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 1f1d5edb7f135a6f7fecb5c48e85455eee96733a, data reload: false

query5	4309	582	459	459
query6	421	206	192	192
query7	4805	453	237	237
query8	334	173	158	158
query9	8802	3968	3950	3950
query10	485	349	296	296
query11	5905	3806	3525	3525
query12	151	98	93	93
query13	1260	455	326	326
query14	6136	4023	3717	3717
query14_1	3505	3514	3531	3514
query15	213	202	185	185
query16	943	448	412	412
query17	883	652	542	542
query18	2427	429	314	314
query19	204	161	136	136
query20	90	94	86	86
query21	213	141	109	109
query22	12998	13178	12804	12804
query23	13686	12824	12503	12503
query23_1	12572	12495	12501	12495
query24	7143	834	464	464
query24_1	480	473	462	462
query25	542	418	362	362
query26	1268	264	142	142
query27	2756	441	265	265
query28	4631	1961	1922	1922
query29	1575	618	464	464
query30	303	227	188	188
query31	1011	935	800	800
query32	142	93	93	93
query33	527	293	242	242
query34	907	853	487	487
query35	735	775	655	655
query36	836	841	775	775
query37	129	104	90	90
query38	1790	1749	1729	1729
query39	809	807	757	757
query39_1	734	736	759	736
query40	218	117	100	100
query41	71	68	68	68
query42	85	85	82	82
query43	364	389	329	329
query44	1299	696	711	696
query45	192	182	166	166
query46	841	952	564	564
query47	3003	2913	2937	2913
query48	286	301	219	219
query49	569	389	291	291
query50	667	290	208	208
query51	10493	10515	10418	10418
query52	82	84	65	65
query53	181	210	156	156
query54	241	218	205	205
query55	71	70	63	63
query56	236	207	201	201
query57	1609	1595	1508	1508
query58	287	261	252	252
query59	2146	2227	1969	1969
query60	283	242	217	217
query61	144	143	147	143
query62	391	346	282	282
query63	200	163	169	163
query64	2783	942	764	764
query65	3259	3244	3219	3219
query66	1770	416	297	297
query67	20215	20215	20074	20074
query68	2994	1000	606	606
query69	390	270	242	242
query70	875	784	767	767
query71	293	223	203	203
query72	2673	2661	2257	2257
query73	510	526	288	288
query74	4568	4466	4316	4316
query75	2349	2285	1925	1925
query76	2280	1022	605	605
query77	333	373	303	303
query78	9793	9819	9212	9212
query79	983	847	519	519
query80	765	444	335	335
query81	551	320	271	271
query82	576	155	107	107
query83	289	188	188	188
query84	306	125	104	104
query85	956	426	373	373
query86	351	245	240	240
query87	2013	1979	1828	1828
query88	3587	2678	2663	2663
query89	344	298	256	256
query90	1707	181	177	177
query91	162	161	126	126
query92	99	104	76	76
query93	992	1005	580	580
query94	502	315	245	245
query95	563	348	369	348
query96	671	526	228	228
query97	2467	2453	2330	2330
query98	167	153	151	151
query99	773	761	646	646
Total cold run time: 234186 ms
Total hot run time: 152163 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.11	0.06	0.05
query3	0.27	0.13	0.12
query4	1.61	0.13	0.13
query5	0.28	0.26	0.24
query6	1.17	0.69	0.70
query7	0.04	0.00	0.00
query8	0.05	0.04	0.03
query9	0.39	0.31	0.36
query10	0.59	0.61	0.59
query11	0.21	0.15	0.14
query12	0.19	0.14	0.14
query13	0.49	0.50	0.49
query14	1.01	1.02	1.01
query15	0.62	0.62	0.62
query16	0.35	0.37	0.36
query17	1.09	1.11	1.11
query18	0.23	0.21	0.20
query19	2.06	1.99	2.00
query20	0.02	0.01	0.02
query21	15.49	0.24	0.14
query22	4.59	0.06	0.05
query23	16.20	0.32	0.12
query24	2.78	0.70	0.47
query25	0.11	0.06	0.05
query26	1.79	0.25	0.15
query27	0.04	0.04	0.03
query28	2.34	0.66	0.42
query29	12.52	4.26	3.35
query30	0.28	0.15	0.14
query31	2.77	0.59	0.34
query32	3.22	0.62	0.53
query33	3.17	3.22	3.20
query34	15.46	4.00	3.38
query35	3.36	3.34	3.34
query36	0.56	0.45	0.43
query37	0.10	0.06	0.07
query38	0.05	0.04	0.04
query39	0.04	0.02	0.02
query40	0.17	0.15	0.14
query41	0.08	0.03	0.02
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 95.99 s
Total hot run time: 24.71 s

@foxtail463
foxtail463 force-pushed the fix/nested-mv-relation-implied-predicates branch from 1f1d5ed to aae24cf Compare October 20, 2026 11:12
@foxtail463

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17613	5157	5028	5028
q2	2098	322	261	261
q3	10244	1386	799	799
q4	4674	455	337	337
q5	7439	791	515	515
q6	179	182	151	151
q7	736	781	595	595
q8	9257	1348	972	972
q9	5516	4177	4149	4149
q10	6817	1291	1003	1003
q11	437	244	225	225
q12	644	395	271	271
q13	18104	3522	3001	3001
q14	270	267	246	246
q15	q16	717	732	649	649
q17	1183	738	596	596
q18	6939	6151	6142	6142
q19	1124	955	597	597
q20	384	335	222	222
q21	4642	2131	2249	2131
q22	342	293	257	257
Total cold run time: 99359 ms
Total hot run time: 28147 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5597	5575	5587	5575
q2	646	559	539	539
q3	5186	5404	4884	4884
q4	1984	2135	1547	1547
q5	5273	5136	5241	5136
q6	326	213	148	148
q7	2282	2121	1867	1867
q8	3074	2592	2662	2592
q9	8032	8093	8034	8034
q10	3736	3653	3201	3201
q11	606	431	419	419
q12	894	707	518	518
q13	3622	3804	3238	3238
q14	318	315	297	297
q15	q16	691	729	699	699
q17	8241	7589	6908	6908
q18	13048	12191	12906	12191
q19	885	776	770	770
q20	2125	2135	1909	1909
q21	5601	4585	4669	4585
q22	497	442	410	410
Total cold run time: 72664 ms
Total hot run time: 65467 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 150893 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 aae24cf5c0481e4bc7800ace7544b01cc6eb6821, data reload: false

query5	4354	581	451	451
query6	422	200	202	200
query7	4824	436	222	222
query8	323	165	162	162
query9	8797	3086	3091	3086
query10	491	312	261	261
query11	6058	3868	3557	3557
query12	142	90	87	87
query13	1256	449	325	325
query14	6143	3908	3622	3622
query14_1	3413	3394	3353	3353
query15	208	201	189	189
query16	960	432	406	406
query17	886	659	552	552
query18	2422	432	312	312
query19	205	167	137	137
query20	84	86	84	84
query21	211	125	107	107
query22	12984	12911	12807	12807
query23	13437	12877	12539	12539
query23_1	12627	12640	12522	12522
query24	7349	815	462	462
query24_1	463	468	469	468
query25	538	426	370	370
query26	1261	257	141	141
query27	2764	439	267	267
query28	4644	1931	1980	1931
query29	1588	623	450	450
query30	291	219	191	191
query31	1010	924	825	825
query32	155	95	99	95
query33	533	310	254	254
query34	936	866	504	504
query35	751	762	651	651
query36	833	802	740	740
query37	128	101	84	84
query38	1809	1746	1655	1655
query39	795	809	746	746
query39_1	736	732	742	732
query40	226	114	101	101
query41	65	60	63	60
query42	87	81	80	80
query43	337	364	313	313
query44	1314	672	692	672
query45	176	184	162	162
query46	832	947	559	559
query47	2926	2784	2715	2715
query48	289	304	220	220
query49	568	403	292	292
query50	658	280	222	222
query51	10557	10331	10345	10331
query52	80	79	68	68
query53	181	205	151	151
query54	224	200	176	176
query55	74	68	63	63
query56	218	208	233	208
query57	1663	1607	1536	1536
query58	288	257	252	252
query59	2138	2124	1993	1993
query60	299	243	242	242
query61	152	147	147	147
query62	392	327	280	280
query63	186	157	153	153
query64	2772	957	797	797
query65	3294	3246	3278	3246
query66	1828	428	302	302
query67	20377	20286	20135	20135
query68	2953	990	598	598
query69	397	289	249	249
query70	853	817	771	771
query71	299	238	210	210
query72	2772	2613	2352	2352
query73	517	528	292	292
query74	4647	4512	4351	4351
query75	2348	2301	1917	1917
query76	2310	1016	598	598
query77	344	369	267	267
query78	9807	9732	9245	9245
query79	983	893	510	510
query80	532	425	334	334
query81	535	317	268	268
query82	589	138	104	104
query83	298	196	184	184
query84	323	131	108	108
query85	835	417	380	380
query86	333	237	228	228
query87	2014	1949	1809	1809
query88	3633	2648	2656	2648
query89	321	281	240	240
query90	1885	166	162	162
query91	166	154	126	126
query92	97	91	91	91
query93	995	990	568	568
query94	454	312	270	270
query95	582	326	296	296
query96	667	477	232	232
query97	2465	2435	2321	2321
query98	172	150	148	148
query99	770	763	655	655
Total cold run time: 234730 ms
Total hot run time: 150893 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.09	0.05	0.05
query3	0.26	0.09	0.09
query4	1.61	0.11	0.10
query5	0.24	0.25	0.25
query6	1.18	0.70	0.68
query7	0.03	0.01	0.01
query8	0.05	0.04	0.03
query9	0.40	0.35	0.35
query10	0.58	0.60	0.60
query11	0.21	0.15	0.14
query12	0.19	0.15	0.14
query13	0.50	0.49	0.49
query14	1.04	1.03	1.01
query15	0.63	0.59	0.61
query16	0.35	0.35	0.35
query17	1.20	1.17	1.14
query18	0.21	0.20	0.19
query19	2.10	2.00	2.01
query20	0.01	0.01	0.02
query21	15.49	0.18	0.13
query22	4.85	0.05	0.05
query23	16.28	0.32	0.12
query24	3.08	0.62	0.40
query25	0.11	0.06	0.07
query26	1.38	0.22	0.15
query27	0.05	0.04	0.05
query28	3.42	0.76	0.36
query29	12.49	4.23	3.29
query30	0.28	0.13	0.10
query31	2.78	0.57	0.32
query32	3.22	0.60	0.50
query33	3.24	3.25	3.20
query34	15.40	4.04	3.40
query35	3.36	3.32	3.34
query36	0.55	0.46	0.43
query37	0.10	0.07	0.06
query38	0.04	0.04	0.03
query39	0.04	0.03	0.03
query40	0.17	0.15	0.14
query41	0.09	0.03	0.03
query42	0.04	0.02	0.03
query43	0.05	0.03	0.03
Total cold run time: 97.4 s
Total hot run time: 24.44 s

@yujun777

Copy link
Copy Markdown
Contributor

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed all 15 changed paths at aae24cf5c0481e4bc7800ace7544b01cc6eb6821, including upstream analysis, cache publication/invalidation, nested matching and downstream compensation. No new actionable findings. The main review and all three assigned reviewers completed their scopes and final rechecks; the review converged in round 1. No additional user focus was supplied.

Critical checkpoint conclusions:

  1. Goal and behavior: candidate-only removal of lower-MV-guaranteed filters supports nested rewriting, including projected-away predicate columns. Query predicates remain available for compensation, and cached definitions remain unchanged. Added unit and data-regression cases exercise these behaviors.
  2. Scope and reuse: the changes are focused and reuse existing predicate pull-up, implication, cache ownership and locking mechanisms.
  3. Concurrency: query planning versus refresh/view/schema/drop paths was traced. MV locks protect generation/state/snapshot transitions; table locks remain ID-ordered; expensive cache planning stays outside the MV lock. No new lock inversion was established.
  4. Lifecycle: immutable facts follow cache/statement ownership. Generation checks reject builds and local entries from earlier planning attempts; partial refresh, failure, replay, IVM and compatibility initialization paths were reviewed. No new resource cycle or initialization hazard found.
  5. Configuration: no configuration added; the existing zero-sized global-cache path is covered by the generation-aware retry test.
  6. Compatibility: no persisted format or FE/BE protocol migration introduced; new output facts remain ephemeral.
  7. Thrift/protobuf: no definitions changed; cross-branch field-ID checks are inapplicable.
  8. Parallel paths: reviewed full/partial plans, sync/async contexts, guarded/unguarded and global/local caches, live/replay and IVM refresh, plus direct/generated/copied scans.
  9. Conditions and semantics: base-index and visible-output mapping, volatile/nondeterministic/alias guards, full partition coverage, DNF overflow, projection/aggregation, outer/mark/ASOF joins and NULL semantics conservatively retain filters when proof is unavailable. Candidate mapping exceptions are caught per candidate.
  10. Test coverage: unit cases cover binding, nested matching, projection, null rejection, hidden IVM columns, aliases/time functions, definition changes, in-flight builds, partial-refresh recovery, disabled-cache retries and stale-upper compensation. The regression additionally compares actual query results.
  11. Expected results: the ordered before/after rows in the new output file match the fixture. This static review cannot establish generator provenance or a runtime pass.
  12. Observability: existing cache-generation/derivation and candidate-failure diagnostics cover the new failure paths; no additional metric requirement identified.
  13. Persistence/failover: existing status/view/task-result journal and replay paths reconstruct snapshot coverage; no new durable expression metadata is required.
  14. Writes and crash boundaries: no new data-write path. Cache publication was checked against successful/failed refresh and invalidation boundaries.
  15. FE/BE variables: none added.
  16. Performance: subtree identity caching and the existing bounded DNF proof budget limit repeated inference. No concrete new performance defect established; runtime performance was not measured.
  17. Other invariants: no additional supported wrong-result path found. Individual rewrite failures decline candidates; BE visible-version, delete-bitmap and memory-accounting paths are unchanged.

Existing review dispositions:

  • Retry finding 4272521191 is fixed: both local-cache lookup sites and publication validate the current MV generation, and refresh/definition invalidation advances it.
  • Direct-write findings 4131025029 / 4140246936 describe the same opt-in mutation limitation already affecting ordinary MV transparency. Mutable-binding findings 4131025038 / 4140246940 share the existing untracked function/variable dependency gap, which also affects ordinary expression-output MVs. These physical scenarios are not claimed fixed. Current mutation gates/dependency code and the existing replies support treating them as pre-existing or unsupported transparency limitations, rather than remaining in-scope blockers for this change; no duplicate inline comments are posted.
  • The existing mapping-assertion concern is covered by per-candidate catches; the requested volatile-check ordering is present. Analysis-time alias/nondeterminism recording remains necessary before expansion/folding erases dependencies.

No unresolved candidates or changed-path coverage gaps remain. Validation was static only: this review contract prohibits builds, tests and source changes. No runtime correctness or test-pass claim is made.

Review converged after 1 round(s).

@yujun777 yujun777 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@yujun777
yujun777 merged commit 9e60fab into apache:master Oct 21, 2026
36 of 37 checks passed
@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Oct 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

hello-stephen pushed a commit that referenced this pull request Oct 21, 2026
Related PR: #69311, #69268, #63639

Problem Summary: #69311 renamed the row binlog (the change stream IVM
reads) to **changelog** and rejected the legacy keys `binlog.format` /
`binlog.need_historical_value` in every DDL. Two test files merged just
before it fell outside that rename sweep and now fail:

1.
`regression-test/suites/mtmv_p0/ivm/test_ivm_datetime_sequence.groovy`
(from #69268) — creates its IVM base tables with `"binlog.enable" =
"true", "binlog.format" = "ROW", "binlog.need_historical_value" =
"true"`, which CREATE TABLE now rejects.
2.
`RelationImpliedPredicateTest#testIvmOutputPredicatesSkipHiddenColumns`
(from #63639) — same legacy properties in the base-table DDL, and it
gates the creation on `enable_feature_binlog` instead of the new
`enable_feature_changelog`.

Fix: switch both to `"changelog.enable" = "true"` (plus
`"changelog.need_historical_value" = "true"` where the before-image is
needed), drop the rejected `binlog.format`, and use
`enable_feature_changelog` as the feature gate in the FE unit test.
Related IVM trace issue: #65418 .
yiguolei pushed a commit that referenced this pull request Oct 29, 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.2.0-merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants