doris icon indicating copy to clipboard operation
doris copied to clipboard

[fix](mtmv) Fix partition mv rewrite result wrong

Open seawinde opened this issue 9 months ago • 17 comments

Proposed changes

this is brought by https://github.com/apache/doris/pull/33800 if mv is partitioned materialzied view, the data will be wrong by using the hited materialized view when the paritions in related base partiton table are deleted, created and so on. this fix the problem.

if SET enable_materialized_view_union_rewrite=true; this will use the materializd view and make sure the data is corrent if SET enable_materialized_view_union_rewrite=false; this will query base table directly to make sure the data is right

Further comments

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

seawinde avatar May 22 '24 14:05 seawinde

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

Since 2024-03-18, the Document has been moved to doris-website. See Doris Document.

doris-robot avatar May 22 '24 14:05 doris-robot

run buildall

seawinde avatar May 22 '24 14:05 seawinde

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

------ Round 1 ----------------------------------
q1	17628	4428	4298	4298
q2	2011	195	199	195
q3	10486	1254	1209	1209
q4	10649	786	791	786
q5	7546	2727	2747	2727
q6	249	135	137	135
q7	982	637	634	634
q8	9775	2118	2115	2115
q9	9173	6675	6690	6675
q10	9218	3804	3739	3739
q11	459	245	233	233
q12	514	216	222	216
q13	17769	2994	2984	2984
q14	251	222	223	222
q15	518	464	486	464
q16	527	392	387	387
q17	963	636	672	636
q18	8168	7505	7467	7467
q19	6634	1565	1511	1511
q20	664	319	324	319
q21	5008	3860	3898	3860
q22	348	293	284	284
Total cold run time: 119540 ms
Total hot run time: 41096 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4339	4256	4206	4206
q2	379	283	271	271
q3	2992	2781	2708	2708
q4	1875	1605	1611	1605
q5	5307	5316	5309	5309
q6	211	126	128	126
q7	2115	1706	1779	1706
q8	3228	3352	3324	3324
q9	8418	8384	8369	8369
q10	3858	3675	3709	3675
q11	578	494	484	484
q12	761	632	605	605
q13	16575	2981	3008	2981
q14	288	262	283	262
q15	511	488	475	475
q16	466	413	435	413
q17	1764	1481	1472	1472
q18	7692	7729	7471	7471
q19	1672	1587	1571	1571
q20	1965	1768	1832	1768
q21	9561	4741	4608	4608
q22	597	502	505	502
Total cold run time: 75152 ms
Total hot run time: 53911 ms

doris-robot avatar May 22 '24 15:05 doris-robot

run buildall

seawinde avatar May 22 '24 15:05 seawinde

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

------ Round 1 ----------------------------------
q1	17610	4315	4443	4315
q2	2013	197	198	197
q3	10440	1235	1235	1235
q4	10194	889	739	739
q5	7474	2710	2620	2620
q6	234	138	143	138
q7	970	616	608	608
q8	9239	2125	2094	2094
q9	9875	6696	6648	6648
q10	9332	3884	3874	3874
q11	444	241	239	239
q12	458	231	232	231
q13	17253	3179	3240	3179
q14	266	234	233	233
q15	514	465	469	465
q16	487	382	384	382
q17	981	723	714	714
q18	8433	7809	7860	7809
q19	4561	1530	1506	1506
q20	634	321	318	318
q21	5176	4039	3995	3995
q22	343	283	277	277
Total cold run time: 116931 ms
Total hot run time: 41816 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4588	4415	4395	4395
q2	376	271	276	271
q3	3131	2893	3006	2893
q4	1869	1600	1581	1581
q5	5476	5523	5460	5460
q6	219	131	125	125
q7	2170	1755	1841	1755
q8	3301	3365	3375	3365
q9	8550	8674	8682	8674
q10	4025	3709	3806	3709
q11	584	494	488	488
q12	805	638	602	602
q13	16887	3141	3137	3137
q14	310	274	260	260
q15	525	493	485	485
q16	483	450	434	434
q17	1801	1541	1490	1490
q18	7750	7521	7445	7445
q19	1646	1572	1542	1542
q20	1992	1800	1789	1789
q21	10506	4788	4695	4695
q22	567	494	479	479
Total cold run time: 77561 ms
Total hot run time: 55074 ms

doris-robot avatar May 22 '24 15:05 doris-robot

TPC-DS: Total hot run time: 172210 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 2b72023e9266d6b3db9c7485861aec8cd6b9af0e, data reload: false

query1	916	373	366	366
query2	6439	2420	2478	2420
query3	6647	210	214	210
query4	23190	17423	17390	17390
query5	4102	423	418	418
query6	243	155	152	152
query7	4584	306	301	301
query8	244	182	172	172
query9	8532	2387	2364	2364
query10	468	290	272	272
query11	10705	10137	9998	9998
query12	134	92	91	91
query13	1641	398	366	366
query14	9199	7551	6736	6736
query15	217	171	175	171
query16	7895	269	269	269
query17	1703	538	535	535
query18	2027	266	266	266
query19	201	162	156	156
query20	98	84	86	84
query21	188	129	127	127
query22	4328	3875	3890	3875
query23	33505	33164	32965	32965
query24	10575	2796	2929	2796
query25	557	355	366	355
query26	707	174	153	153
query27	2210	323	336	323
query28	5595	2047	2068	2047
query29	847	608	603	603
query30	231	169	173	169
query31	989	773	746	746
query32	99	52	55	52
query33	656	295	258	258
query34	889	473	469	469
query35	748	596	572	572
query36	1108	910	903	903
query37	110	70	72	70
query38	2914	2820	2727	2727
query39	872	790	813	790
query40	194	154	124	124
query41	45	43	47	43
query42	107	99	97	97
query43	603	568	541	541
query44	1108	736	733	733
query45	185	171	161	161
query46	1064	727	722	722
query47	1869	1781	1776	1776
query48	371	300	295	295
query49	857	387	393	387
query50	779	398	398	398
query51	6984	6880	6823	6823
query52	111	97	94	94
query53	351	288	289	288
query54	873	431	430	430
query55	78	79	73	73
query56	268	244	272	244
query57	1127	1035	1052	1035
query58	257	223	210	210
query59	3405	3078	3272	3078
query60	284	255	265	255
query61	90	88	92	88
query62	615	453	457	453
query63	313	292	294	292
query64	8526	2246	1704	1704
query65	3153	3093	3099	3093
query66	782	322	321	321
query67	15085	14714	14903	14714
query68	5576	562	566	562
query69	498	275	268	268
query70	1151	1080	1153	1080
query71	433	275	277	275
query72	8560	5561	5485	5485
query73	788	340	329	329
query74	6115	5697	5614	5614
query75	3527	2608	2643	2608
query76	3297	998	1014	998
query77	576	278	277	277
query78	10233	9913	9738	9738
query79	2087	517	528	517
query80	1358	471	466	466
query81	524	251	241	241
query82	1281	103	98	98
query83	243	190	184	184
query84	266	91	93	91
query85	1435	331	311	311
query86	454	302	284	284
query87	3350	3096	3137	3096
query88	3791	2375	2375	2375
query89	490	392	381	381
query90	1995	203	197	197
query91	140	110	110	110
query92	61	50	51	50
query93	2071	514	507	507
query94	1238	201	204	201
query95	434	330	336	330
query96	596	268	270	268
query97	3204	3001	3002	3001
query98	246	232	215	215
query99	1228	844	851	844
Total cold run time: 273043 ms
Total hot run time: 172210 ms

doris-robot avatar May 22 '24 16:05 doris-robot

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

query1	0.04	0.03	0.04
query2	0.08	0.03	0.04
query3	0.23	0.05	0.04
query4	1.68	0.07	0.07
query5	0.50	0.49	0.51
query6	1.12	0.72	0.71
query7	0.02	0.01	0.02
query8	0.05	0.04	0.04
query9	0.52	0.49	0.50
query10	0.55	0.55	0.53
query11	0.16	0.12	0.11
query12	0.14	0.11	0.12
query13	0.59	0.59	0.59
query14	0.77	0.77	0.77
query15	0.84	0.80	0.83
query16	0.35	0.37	0.38
query17	1.01	0.98	0.94
query18	0.21	0.25	0.22
query19	1.79	1.69	1.71
query20	0.02	0.01	0.01
query21	15.41	0.74	0.69
query22	4.09	7.19	2.56
query23	18.28	1.44	1.28
query24	1.40	0.42	0.22
query25	0.14	0.09	0.09
query26	0.28	0.16	0.16
query27	0.07	0.09	0.08
query28	13.29	1.02	1.00
query29	12.96	3.34	3.25
query30	0.25	0.06	0.05
query31	2.88	0.37	0.39
query32	3.30	0.47	0.46
query33	2.82	2.87	2.82
query34	17.18	4.45	4.40
query35	4.53	4.47	4.59
query36	0.68	0.48	0.45
query37	0.18	0.15	0.15
query38	0.15	0.14	0.14
query39	0.04	0.04	0.03
query40	0.18	0.14	0.15
query41	0.09	0.05	0.05
query42	0.06	0.05	0.05
query43	0.04	0.03	0.04
Total cold run time: 108.97 s
Total hot run time: 30.99 s

doris-robot avatar May 22 '24 16:05 doris-robot

run buildall

seawinde avatar May 23 '24 13:05 seawinde

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

------ Round 1 ----------------------------------
q1	17612	4225	4198	4198
q2	2012	186	186	186
q3	10470	1237	1171	1171
q4	10197	745	843	745
q5	7480	2701	2801	2701
q6	219	134	137	134
q7	965	604	602	602
q8	9219	2129	2094	2094
q9	9408	6732	6665	6665
q10	9365	3991	3917	3917
q11	447	249	234	234
q12	514	252	219	219
q13	17385	3177	3227	3177
q14	273	215	210	210
q15	505	471	480	471
q16	486	382	397	382
q17	972	648	686	648
q18	8385	7845	7806	7806
q19	4497	1533	1474	1474
q20	636	320	312	312
q21	5208	3212	3257	3212
q22	366	274	279	274
Total cold run time: 116621 ms
Total hot run time: 40832 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4450	4449	4448	4448
q2	379	268	276	268
q3	3186	2968	2921	2921
q4	1998	1605	1604	1604
q5	5329	5468	5480	5468
q6	222	124	127	124
q7	2229	1797	1803	1797
q8	3260	3452	3380	3380
q9	8578	8636	8667	8636
q10	4091	3745	3733	3733
q11	591	492	497	492
q12	795	605	612	605
q13	16919	3147	3165	3147
q14	297	258	270	258
q15	523	496	488	488
q16	494	449	451	449
q17	1820	1525	1475	1475
q18	7621	7715	7480	7480
q19	1664	1550	1555	1550
q20	2017	1797	1776	1776
q21	12018	4605	4639	4605
q22	553	479	471	471
Total cold run time: 79034 ms
Total hot run time: 55175 ms

doris-robot avatar May 24 '24 00:05 doris-robot

TPC-DS: Total hot run time: 168496 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 395b20f9d9bf83aa459ee6951f0d37e709061002, data reload: false

query1	922	392	373	373
query2	6437	2402	2205	2205
query3	6635	210	210	210
query4	19818	17212	17322	17212
query5	4118	423	450	423
query6	235	164	155	155
query7	4594	305	306	305
query8	236	184	179	179
query9	8726	2360	2342	2342
query10	446	281	260	260
query11	10391	10105	9989	9989
query12	141	89	92	89
query13	1642	370	366	366
query14	8965	6958	6884	6884
query15	209	170	169	169
query16	7439	265	263	263
query17	1292	525	501	501
query18	1910	275	270	270
query19	191	147	151	147
query20	91	84	87	84
query21	198	125	131	125
query22	4092	3998	3826	3826
query23	33807	33050	33127	33050
query24	6944	2854	2841	2841
query25	550	358	358	358
query26	707	159	161	159
query27	1949	331	331	331
query28	3749	2028	2029	2028
query29	846	609	623	609
query30	281	176	172	172
query31	959	770	736	736
query32	96	53	54	53
query33	502	262	264	262
query34	860	463	464	463
query35	726	599	597	597
query36	1053	911	908	908
query37	108	69	73	69
query38	2883	2765	2771	2765
query39	863	809	780	780
query40	197	127	125	125
query41	48	44	43	43
query42	104	95	98	95
query43	591	542	545	542
query44	1087	715	734	715
query45	186	160	159	159
query46	1069	736	724	724
query47	1828	1755	1754	1754
query48	386	293	301	293
query49	768	377	395	377
query50	781	384	392	384
query51	6853	6761	6859	6761
query52	104	87	93	87
query53	354	285	291	285
query54	528	424	424	424
query55	73	78	74	74
query56	276	254	248	248
query57	1134	1035	1062	1035
query58	233	217	209	209
query59	3364	3118	3137	3118
query60	276	253	248	248
query61	90	90	86	86
query62	570	473	452	452
query63	320	289	291	289
query64	8477	2239	1697	1697
query65	3137	3117	3114	3114
query66	834	336	319	319
query67	15067	14698	15063	14698
query68	4525	540	547	540
query69	433	269	315	269
query70	1155	1064	1159	1064
query71	398	283	262	262
query72	7677	2695	2590	2590
query73	709	325	320	320
query74	6097	5504	5581	5504
query75	3317	2625	2645	2625
query76	2270	973	949	949
query77	374	269	268	268
query78	10363	9631	9679	9631
query79	2235	532	522	522
query80	815	454	440	440
query81	514	243	246	243
query82	1087	97	94	94
query83	236	169	172	169
query84	251	85	82	82
query85	1152	275	314	275
query86	463	327	336	327
query87	3265	3132	3036	3036
query88	4223	2317	2322	2317
query89	471	404	398	398
query90	2106	189	190	189
query91	125	96	95	95
query92	60	49	51	49
query93	2075	514	501	501
query94	1123	190	183	183
query95	396	308	310	308
query96	592	271	270	270
query97	3177	2998	2996	2996
query98	251	224	221	221
query99	1151	857	846	846
Total cold run time: 257432 ms
Total hot run time: 168496 ms

doris-robot avatar May 24 '24 00:05 doris-robot

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

query1	0.04	0.03	0.03
query2	0.09	0.04	0.04
query3	0.23	0.05	0.05
query4	1.68	0.07	0.08
query5	0.48	0.50	0.50
query6	1.13	0.73	0.73
query7	0.02	0.02	0.01
query8	0.04	0.04	0.05
query9	0.55	0.49	0.50
query10	0.54	0.54	0.55
query11	0.15	0.11	0.11
query12	0.13	0.12	0.12
query13	0.59	0.59	0.59
query14	0.78	0.77	0.78
query15	0.82	0.82	0.80
query16	0.35	0.38	0.35
query17	0.99	0.98	1.00
query18	0.20	0.25	0.23
query19	1.76	1.69	1.65
query20	0.01	0.00	0.01
query21	15.56	0.68	0.66
query22	4.27	7.77	1.73
query23	18.26	1.41	1.27
query24	1.59	0.23	0.30
query25	0.15	0.09	0.08
query26	0.26	0.17	0.17
query27	0.08	0.07	0.08
query28	13.35	1.01	0.98
query29	13.84	3.27	3.22
query30	0.23	0.06	0.05
query31	2.88	0.38	0.39
query32	3.26	0.47	0.46
query33	2.89	2.91	2.90
query34	17.29	4.48	4.46
query35	4.54	4.61	4.66
query36	0.64	0.45	0.46
query37	0.17	0.15	0.15
query38	0.15	0.14	0.14
query39	0.05	0.04	0.04
query40	0.17	0.14	0.14
query41	0.09	0.06	0.05
query42	0.06	0.05	0.05
query43	0.04	0.04	0.03
Total cold run time: 110.4 s
Total hot run time: 30.42 s

doris-robot avatar May 24 '24 01:05 doris-robot