Skip to content

Conversation

@englefly
Copy link
Contributor

@englefly englefly commented Jun 24, 2024

  1. update rowcount if some partitions are pruned
  2. refactor StatsCalcualtor for Scan

@doris-robot
Copy link

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.

@englefly
Copy link
Contributor Author

run buildall

1 similar comment
@englefly
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17953	4447	4365	4365
q2	2569	194	200	194
q3	11592	1187	1179	1179
q4	10550	898	808	808
q5	7837	2683	2659	2659
q6	222	136	136	136
q7	971	601	629	601
q8	9247	2049	2032	2032
q9	8790	6474	6450	6450
q10	8996	3735	3725	3725
q11	457	247	245	245
q12	399	238	224	224
q13	18909	2994	2996	2994
q14	270	227	216	216
q15	526	486	481	481
q16	530	377	372	372
q17	956	700	712	700
q18	8121	7504	7372	7372
q19	7218	1553	1536	1536
q20	654	318	327	318
q21	4843	4009	3248	3248
q22	409	346	352	346
Total cold run time: 122019 ms
Total hot run time: 40201 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4394	4264	4254	4254
q2	374	271	274	271
q3	2996	2789	2714	2714
q4	1880	1572	1611	1572
q5	5260	5290	5288	5288
q6	217	129	128	128
q7	2145	1759	1724	1724
q8	3181	3337	3324	3324
q9	8301	8353	8326	8326
q10	3891	3696	3648	3648
q11	585	508	499	499
q12	786	571	644	571
q13	16599	3006	2995	2995
q14	301	262	256	256
q15	534	478	491	478
q16	471	428	426	426
q17	1788	1503	1459	1459
q18	7752	7581	7373	7373
q19	1705	1526	1470	1470
q20	1998	1786	1749	1749
q21	10384	4649	4771	4649
q22	634	552	544	544
Total cold run time: 76176 ms
Total hot run time: 53718 ms

@doris-robot
Copy link

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

query1	949	395	379	379
query2	6470	2581	2437	2437
query3	6653	209	212	209
query4	20239	17603	17334	17334
query5	4190	495	467	467
query6	272	177	192	177
query7	4601	303	312	303
query8	320	311	303	303
query9	8721	2487	2460	2460
query10	636	277	295	277
query11	10706	10029	9983	9983
query12	135	85	81	81
query13	1635	377	385	377
query14	10171	7591	7384	7384
query15	262	187	186	186
query16	8157	267	263	263
query17	1913	561	533	533
query18	2109	270	275	270
query19	263	154	149	149
query20	88	83	79	79
query21	213	129	122	122
query22	4261	3965	3947	3947
query23	33786	32932	33275	32932
query24	10728	2801	2871	2801
query25	609	360	358	358
query26	1151	151	149	149
query27	2743	316	319	316
query28	7251	2109	2110	2109
query29	868	620	602	602
query30	275	150	152	150
query31	949	732	728	728
query32	96	52	53	52
query33	793	294	289	289
query34	975	472	472	472
query35	723	642	599	599
query36	1103	902	923	902
query37	153	72	70	70
query38	2881	2747	2784	2747
query39	888	810	775	775
query40	203	122	125	122
query41	55	52	54	52
query42	127	100	97	97
query43	609	558	550	550
query44	1223	724	728	724
query45	198	165	161	161
query46	1070	759	742	742
query47	1829	1769	1789	1769
query48	367	296	301	296
query49	1058	404	400	400
query50	781	388	386	386
query51	6840	6822	6812	6812
query52	106	102	94	94
query53	362	293	284	284
query54	928	446	449	446
query55	75	75	75	75
query56	285	269	259	259
query57	1129	1059	1045	1045
query58	255	236	242	236
query59	3632	3169	3437	3169
query60	297	284	271	271
query61	93	90	95	90
query62	658	442	432	432
query63	320	295	293	293
query64	8948	2244	1775	1775
query65	3192	3140	3104	3104
query66	838	356	329	329
query67	15388	14933	14879	14879
query68	4536	546	557	546
query69	460	324	316	316
query70	1171	1119	1130	1119
query71	395	276	267	267
query72	7335	5314	5583	5314
query73	745	335	326	326
query74	5975	5517	5562	5517
query75	3471	2724	2651	2651
query76	2743	996	938	938
query77	498	311	308	308
query78	10381	9922	9739	9739
query79	2552	513	507	507
query80	1093	478	464	464
query81	602	218	222	218
query82	718	104	103	103
query83	228	168	167	167
query84	230	92	86	86
query85	1992	283	271	271
query86	495	326	323	323
query87	3253	3087	3145	3087
query88	4375	2441	2426	2426
query89	470	389	377	377
query90	1815	189	184	184
query91	128	104	102	102
query92	67	51	51	51
query93	2156	507	516	507
query94	1209	198	192	192
query95	427	321	317	317
query96	591	275	271	271
query97	3264	2988	3055	2988
query98	284	203	200	200
query99	1356	857	816	816
Total cold run time: 274817 ms
Total hot run time: 173361 ms

@doris-robot
Copy link

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

query1	0.05	0.03	0.03
query2	0.08	0.04	0.04
query3	0.22	0.06	0.06
query4	1.67	0.08	0.10
query5	0.50	0.50	0.50
query6	1.13	0.73	0.72
query7	0.02	0.01	0.01
query8	0.05	0.05	0.05
query9	0.54	0.49	0.50
query10	0.54	0.56	0.56
query11	0.15	0.11	0.12
query12	0.15	0.12	0.12
query13	0.60	0.59	0.61
query14	0.78	0.78	0.77
query15	0.82	0.82	0.82
query16	0.36	0.37	0.37
query17	1.00	0.97	1.04
query18	0.22	0.26	0.24
query19	1.82	1.69	1.75
query20	0.01	0.01	0.01
query21	15.41	0.74	0.65
query22	3.95	7.22	1.96
query23	18.30	1.32	1.36
query24	2.12	0.22	0.21
query25	0.17	0.09	0.09
query26	0.27	0.17	0.17
query27	0.08	0.09	0.07
query28	13.24	1.01	1.00
query29	12.59	3.32	3.26
query30	0.26	0.07	0.05
query31	2.87	0.38	0.39
query32	3.28	0.47	0.48
query33	2.90	2.90	2.90
query34	17.21	4.43	4.45
query35	4.49	4.51	4.44
query36	0.65	0.47	0.48
query37	0.17	0.14	0.15
query38	0.15	0.15	0.15
query39	0.04	0.04	0.04
query40	0.18	0.14	0.16
query41	0.08	0.05	0.04
query42	0.05	0.05	0.05
query43	0.04	0.04	0.04
Total cold run time: 109.21 s
Total hot run time: 30.7 s

@englefly
Copy link
Contributor Author

run p0

@englefly
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17630	4291	4299	4291
q2	2026	190	196	190
q3	10454	1214	1053	1053
q4	10187	834	756	756
q5	7476	2650	2610	2610
q6	224	134	133	133
q7	937	596	606	596
q8	9220	2045	2040	2040
q9	9031	6448	6486	6448
q10	9006	3692	3741	3692
q11	480	236	238	236
q12	428	228	221	221
q13	17852	2990	2953	2953
q14	263	225	226	225
q15	526	481	486	481
q16	519	377	379	377
q17	949	641	717	641
q18	7997	7493	7404	7404
q19	6674	1510	1457	1457
q20	665	319	322	319
q21	4880	3061	3147	3061
q22	393	329	330	329
Total cold run time: 117817 ms
Total hot run time: 39513 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4389	4280	4228	4228
q2	368	271	269	269
q3	3020	2814	2853	2814
q4	2008	1726	1698	1698
q5	5664	5518	5500	5500
q6	229	128	126	126
q7	2155	1804	1864	1804
q8	3240	3366	3401	3366
q9	8689	8678	8816	8678
q10	4079	3969	3692	3692
q11	574	495	483	483
q12	837	660	643	643
q13	16063	3165	3162	3162
q14	295	275	260	260
q15	524	478	492	478
q16	493	428	413	413
q17	1806	1502	1503	1502
q18	8008	7954	7821	7821
q19	1837	1653	1700	1653
q20	3046	1893	1842	1842
q21	5102	5004	5018	5004
q22	599	535	538	535
Total cold run time: 73025 ms
Total hot run time: 55971 ms

@doris-robot
Copy link

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

query1	913	385	375	375
query2	6434	2511	2384	2384
query3	6635	206	212	206
query4	19305	17385	17383	17383
query5	3594	456	481	456
query6	259	185	160	160
query7	4586	304	290	290
query8	311	281	289	281
query9	8528	2462	2438	2438
query10	578	296	309	296
query11	10494	9979	10043	9979
query12	120	86	84	84
query13	1659	368	369	368
query14	8729	7552	7562	7552
query15	237	189	188	188
query16	7774	279	277	277
query17	1890	558	528	528
query18	1965	288	280	280
query19	208	160	157	157
query20	90	84	83	83
query21	214	129	125	125
query22	4487	4169	4158	4158
query23	34089	33693	33825	33693
query24	10850	2862	2974	2862
query25	638	401	398	398
query26	960	159	165	159
query27	2406	327	333	327
query28	6514	2179	2158	2158
query29	932	658	627	627
query30	250	169	173	169
query31	1007	742	781	742
query32	104	56	62	56
query33	783	307	303	303
query34	1070	489	501	489
query35	755	648	658	648
query36	1158	968	993	968
query37	147	78	78	78
query38	2963	2870	2848	2848
query39	897	816	797	797
query40	207	126	127	126
query41	54	55	52	52
query42	131	102	106	102
query43	598	521	539	521
query44	1207	739	718	718
query45	199	168	178	168
query46	1074	743	744	743
query47	1839	1787	1799	1787
query48	367	313	307	307
query49	859	421	427	421
query50	860	387	390	387
query51	6847	6911	6753	6753
query52	99	95	94	94
query53	358	290	292	290
query54	895	445	444	444
query55	77	75	73	73
query56	281	288	256	256
query57	1105	1045	1032	1032
query58	253	246	246	246
query59	3314	3023	3197	3023
query60	311	272	282	272
query61	97	103	85	85
query62	595	452	454	452
query63	324	289	290	289
query64	8648	2281	1715	1715
query65	3164	3078	3125	3078
query66	753	332	330	330
query67	15577	15052	14864	14864
query68	8505	550	543	543
query69	719	469	409	409
query70	1426	1089	1116	1089
query71	525	277	271	271
query72	9011	2762	2629	2629
query73	2273	325	324	324
query74	5870	5454	5568	5454
query75	5149	2639	2652	2639
query76	5241	933	918	918
query77	783	308	292	292
query78	10627	10030	9844	9844
query79	7717	514	523	514
query80	2405	466	465	465
query81	566	226	222	222
query82	480	108	112	108
query83	304	184	209	184
query84	270	88	86	86
query85	917	270	263	263
query86	357	311	291	291
query87	3311	3154	3091	3091
query88	4436	2443	2431	2431
query89	496	379	382	379
query90	2073	200	190	190
query91	127	97	99	97
query92	58	52	52	52
query93	5636	506	495	495
query94	1277	187	190	187
query95	410	315	309	309
query96	612	271	271	271
query97	3277	3037	2999	2999
query98	212	211	197	197
query99	1179	855	871	855
Total cold run time: 290875 ms
Total hot run time: 172096 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.08	0.04	0.05
query3	0.22	0.05	0.06
query4	1.67	0.08	0.10
query5	0.49	0.50	0.50
query6	1.14	0.72	0.75
query7	0.02	0.01	0.02
query8	0.05	0.05	0.05
query9	0.55	0.52	0.50
query10	0.54	0.55	0.55
query11	0.15	0.12	0.12
query12	0.15	0.12	0.12
query13	0.59	0.58	0.60
query14	0.77	0.77	0.79
query15	0.86	0.82	0.82
query16	0.35	0.37	0.37
query17	1.02	1.02	0.98
query18	0.23	0.24	0.27
query19	1.80	1.78	1.74
query20	0.02	0.01	0.01
query21	15.43	0.76	0.65
query22	4.04	8.05	1.36
query23	18.29	1.50	1.33
query24	2.10	0.22	0.23
query25	0.16	0.09	0.08
query26	0.28	0.17	0.16
query27	0.07	0.07	0.08
query28	13.25	1.02	1.00
query29	12.68	3.26	3.20
query30	0.26	0.05	0.07
query31	2.85	0.39	0.38
query32	3.29	0.47	0.48
query33	2.85	2.95	2.88
query34	17.20	4.42	4.44
query35	4.53	4.57	4.50
query36	0.65	0.47	0.47
query37	0.18	0.15	0.15
query38	0.15	0.14	0.14
query39	0.04	0.03	0.03
query40	0.17	0.14	0.14
query41	0.10	0.05	0.05
query42	0.06	0.05	0.05
query43	0.05	0.04	0.04
Total cold run time: 109.42 s
Total hot run time: 30.12 s

@englefly
Copy link
Contributor Author

run p0

@englefly
Copy link
Contributor Author

run feut

@englefly
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18094	4473	4390	4390
q2	2578	213	209	209
q3	12772	1200	1206	1200
q4	11074	806	804	804
q5	7630	2694	2611	2611
q6	219	139	139	139
q7	955	611	610	610
q8	9241	2073	2051	2051
q9	8912	6487	6523	6487
q10	9028	3730	3730	3730
q11	472	242	244	242
q12	454	232	234	232
q13	17773	3037	3007	3007
q14	272	220	217	217
q15	518	468	477	468
q16	514	372	384	372
q17	957	683	709	683
q18	8077	7525	7379	7379
q19	4490	1472	1461	1461
q20	637	324	346	324
q21	4884	3147	3894	3147
q22	406	342	334	334
Total cold run time: 119957 ms
Total hot run time: 40097 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4341	4252	4263	4252
q2	364	270	277	270
q3	3004	2780	2772	2772
q4	1871	1659	1596	1596
q5	5220	5300	5265	5265
q6	213	130	131	130
q7	2146	1715	1770	1715
q8	3200	3336	3318	3318
q9	8360	8316	8242	8242
q10	3885	3704	3681	3681
q11	587	516	487	487
q12	804	653	613	613
q13	17547	2983	3017	2983
q14	296	265	252	252
q15	519	490	480	480
q16	496	412	423	412
q17	1753	1508	1480	1480
q18	7638	7348	7340	7340
q19	1663	1546	1587	1546
q20	1974	1802	1777	1777
q21	5119	4718	4787	4718
q22	636	561	561	561
Total cold run time: 71636 ms
Total hot run time: 53890 ms

@doris-robot
Copy link

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

query1	933	374	373	373
query2	7216	2372	2356	2356
query3	6657	214	219	214
query4	18745	17615	17355	17355
query5	4210	467	480	467
query6	267	170	173	170
query7	4598	300	300	300
query8	301	269	296	269
query9	8468	2465	2457	2457
query10	618	303	287	287
query11	10465	10023	9913	9913
query12	133	88	83	83
query13	1647	389	390	389
query14	9539	7535	7647	7535
query15	235	185	182	182
query16	7991	276	271	271
query17	1886	557	519	519
query18	1944	268	268	268
query19	197	147	151	147
query20	88	82	82	82
query21	224	126	127	126
query22	4463	4111	3947	3947
query23	33642	33078	32910	32910
query24	11080	2789	2848	2789
query25	598	359	363	359
query26	1131	152	152	152
query27	2921	313	315	313
query28	7451	2106	2095	2095
query29	863	610	600	600
query30	266	159	151	151
query31	964	738	760	738
query32	98	52	55	52
query33	766	282	310	282
query34	926	468	480	468
query35	724	619	600	600
query36	1101	971	957	957
query37	152	67	70	67
query38	2826	2713	2734	2713
query39	869	795	795	795
query40	209	125	139	125
query41	55	53	54	53
query42	130	98	104	98
query43	607	514	547	514
query44	1200	730	733	730
query45	196	161	163	161
query46	1064	738	721	721
query47	1840	1772	1749	1749
query48	391	297	291	291
query49	1082	416	401	401
query50	757	389	405	389
query51	6940	6834	6743	6743
query52	100	89	93	89
query53	360	292	295	292
query54	878	443	466	443
query55	76	74	76	74
query56	287	303	272	272
query57	1132	1030	1061	1030
query58	262	250	247	247
query59	3481	3234	3261	3234
query60	303	285	284	284
query61	92	88	88	88
query62	636	436	461	436
query63	318	290	291	290
query64	8911	2300	1773	1773
query65	3188	3142	3081	3081
query66	891	349	334	334
query67	15308	14856	14814	14814
query68	5369	533	549	533
query69	651	452	351	351
query70	1211	1094	1152	1094
query71	444	277	281	277
query72	7178	2873	2589	2589
query73	764	328	327	327
query74	5859	5522	5460	5460
query75	3812	2645	2715	2645
query76	3200	1044	937	937
query77	645	304	300	300
query78	10309	9940	9683	9683
query79	2145	514	522	514
query80	845	490	465	465
query81	585	216	222	216
query82	1427	105	109	105
query83	222	163	165	163
query84	233	89	85	85
query85	1602	275	269	269
query86	490	320	340	320
query87	3246	3072	3058	3058
query88	4021	2479	2481	2479
query89	480	384	382	382
query90	1771	190	196	190
query91	130	102	104	102
query92	59	50	48	48
query93	2141	511	495	495
query94	1222	186	187	186
query95	404	309	309	309
query96	583	279	272	272
query97	3233	3042	3077	3042
query98	214	200	194	194
query99	1228	830	858	830
Total cold run time: 273620 ms
Total hot run time: 170427 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.04
query2	0.07	0.04	0.04
query3	0.23	0.06	0.05
query4	1.66	0.09	0.09
query5	0.51	0.50	0.49
query6	1.15	0.73	0.73
query7	0.02	0.01	0.02
query8	0.05	0.05	0.05
query9	0.55	0.49	0.50
query10	0.56	0.55	0.55
query11	0.16	0.11	0.12
query12	0.15	0.12	0.12
query13	0.59	0.58	0.60
query14	0.80	0.78	0.76
query15	0.83	0.80	0.79
query16	0.36	0.36	0.37
query17	0.97	1.01	1.03
query18	0.22	0.23	0.23
query19	1.85	1.74	1.85
query20	0.01	0.00	0.00
query21	15.45	0.74	0.64
query22	3.91	7.41	2.13
query23	18.22	1.43	1.33
query24	2.17	0.23	0.22
query25	0.17	0.09	0.09
query26	0.27	0.18	0.18
query27	0.09	0.07	0.08
query28	13.19	1.02	0.99
query29	12.61	3.29	3.29
query30	0.26	0.06	0.05
query31	2.86	0.38	0.38
query32	3.28	0.47	0.50
query33	2.92	2.88	2.89
query34	17.48	4.44	4.38
query35	4.48	4.44	4.49
query36	0.65	0.45	0.47
query37	0.18	0.15	0.16
query38	0.15	0.14	0.14
query39	0.04	0.03	0.04
query40	0.17	0.14	0.15
query41	0.09	0.04	0.04
query42	0.05	0.05	0.05
query43	0.04	0.04	0.04
Total cold run time: 109.51 s
Total hot run time: 30.82 s

@englefly
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17639	4324	4227	4227
q2	2011	215	200	200
q3	10735	1204	1084	1084
q4	10552	764	818	764
q5	7493	2724	2725	2724
q6	232	141	139	139
q7	975	612	619	612
q8	9590	2105	2093	2093
q9	9107	6579	6567	6567
q10	9388	3721	3681	3681
q11	459	247	243	243
q12	460	228	215	215
q13	17764	2957	2974	2957
q14	254	216	216	216
q15	520	485	477	477
q16	511	379	385	379
q17	970	725	703	703
q18	8042	7362	7381	7362
q19	5148	1520	1447	1447
q20	665	329	332	329
q21	4877	3148	3847	3148
q22	405	339	348	339
Total cold run time: 117797 ms
Total hot run time: 39906 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4425	4239	4219	4219
q2	364	271	261	261
q3	2980	2723	2724	2723
q4	1851	1606	1618	1606
q5	5262	5267	5244	5244
q6	213	129	129	129
q7	2100	1762	1725	1725
q8	3220	3317	3293	3293
q9	8299	8301	8201	8201
q10	3858	3730	3619	3619
q11	603	484	491	484
q12	773	611	573	573
q13	16489	2974	2963	2963
q14	303	262	266	262
q15	518	487	471	471
q16	455	415	418	415
q17	1768	1476	1466	1466
q18	7581	7378	7426	7378
q19	1660	1541	1596	1541
q20	1995	1790	1789	1789
q21	10514	4730	4849	4730
q22	625	530	560	530
Total cold run time: 75856 ms
Total hot run time: 53622 ms

@doris-robot
Copy link

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

query1	940	389	379	379
query2	6455	2583	2248	2248
query3	6639	207	220	207
query4	19176	17513	17126	17126
query5	4237	485	480	480
query6	253	176	167	167
query7	4591	298	299	298
query8	316	284	298	284
query9	8359	2465	2444	2444
query10	607	307	291	291
query11	10572	9936	9962	9936
query12	130	95	84	84
query13	1668	367	372	367
query14	10391	8105	7098	7098
query15	249	188	195	188
query16	8058	267	265	265
query17	1905	562	515	515
query18	1993	272	289	272
query19	189	157	154	154
query20	94	83	82	82
query21	216	129	125	125
query22	4428	3994	3992	3992
query23	33802	33045	33048	33045
query24	11799	2800	2843	2800
query25	622	358	356	356
query26	1690	154	156	154
query27	2905	322	321	321
query28	7344	2092	2087	2087
query29	1008	646	642	642
query30	293	155	148	148
query31	950	733	757	733
query32	98	52	57	52
query33	764	293	288	288
query34	944	467	481	467
query35	735	634	614	614
query36	1089	977	943	943
query37	166	71	71	71
query38	2842	2761	2698	2698
query39	887	809	789	789
query40	280	132	129	129
query41	61	55	52	52
query42	124	100	104	100
query43	594	551	521	521
query44	1230	729	725	725
query45	202	163	159	159
query46	1071	697	695	695
query47	1841	1721	1755	1721
query48	373	306	295	295
query49	1126	415	434	415
query50	763	393	397	393
query51	6875	6768	6715	6715
query52	106	93	94	93
query53	370	301	304	301
query54	867	455	447	447
query55	77	75	76	75
query56	290	267	268	267
query57	1170	1021	1077	1021
query58	258	246	251	246
query59	3432	3268	3295	3268
query60	309	285	284	284
query61	92	94	98	94
query62	659	478	462	462
query63	318	295	301	295
query64	9958	2246	1774	1774
query65	3189	3116	3303	3116
query66	1363	344	330	330
query67	15286	14840	14833	14833
query68	6205	549	538	538
query69	660	469	433	433
query70	1189	1152	1165	1152
query71	437	283	283	283
query72	7333	5845	5942	5845
query73	793	329	330	329
query74	5978	5469	5461	5461
query75	3930	2666	2739	2666
query76	3718	950	991	950
query77	693	323	315	315
query78	10646	9877	9696	9696
query79	3862	521	512	512
query80	1171	518	498	498
query81	573	228	229	228
query82	731	114	107	107
query83	211	182	181	181
query84	286	98	95	95
query85	1335	343	330	330
query86	405	315	282	282
query87	3282	3053	3070	3053
query88	4351	2501	2481	2481
query89	511	385	405	385
query90	1887	200	201	200
query91	142	114	116	114
query92	65	52	55	52
query93	4829	514	512	512
query94	1203	202	200	200
query95	418	331	334	331
query96	616	279	270	270
query97	3201	3036	3026	3026
query98	217	204	196	196
query99	1255	846	830	830
Total cold run time: 283821 ms
Total hot run time: 173587 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.08	0.04	0.04
query3	0.22	0.05	0.06
query4	1.67	0.07	0.07
query5	0.48	0.47	0.50
query6	1.14	0.72	0.72
query7	0.02	0.02	0.01
query8	0.05	0.04	0.04
query9	0.57	0.49	0.49
query10	0.54	0.55	0.55
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.59	0.59	0.60
query14	0.77	0.77	0.77
query15	0.85	0.83	0.81
query16	0.36	0.37	0.37
query17	1.01	1.06	0.97
query18	0.20	0.24	0.23
query19	1.82	1.70	1.80
query20	0.03	0.01	0.01
query21	15.45	0.73	0.64
query22	4.03	7.20	2.06
query23	18.28	1.32	1.32
query24	2.11	0.22	0.23
query25	0.16	0.08	0.09
query26	0.27	0.18	0.18
query27	0.08	0.09	0.08
query28	13.22	1.02	1.02
query29	12.61	3.29	3.30
query30	0.25	0.06	0.05
query31	2.86	0.41	0.39
query32	3.70	0.48	0.48
query33	2.87	2.92	2.87
query34	17.14	4.38	4.42
query35	4.47	4.47	4.51
query36	0.64	0.46	0.47
query37	0.18	0.16	0.15
query38	0.15	0.15	0.15
query39	0.04	0.03	0.04
query40	0.17	0.14	0.15
query41	0.09	0.04	0.05
query42	0.05	0.04	0.04
query43	0.04	0.03	0.04
Total cold run time: 109.61 s
Total hot run time: 30.72 s

* if this is mv, return selectedIndexId, o.w -1
* @return -1 or selectedIndexId
*/
long getSelectedIndexIdForMV();
Copy link
Contributor

Choose a reason for hiding this comment

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

only for sync mv? if true, rename to ForSyncMv

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for both

Comment on lines +64 to +65
public Set<Map.Entry<Expression, ColumnStatistic>> getExpressionColumnStatsEntries() {
return expressionToColumnStats.entrySet();
Copy link
Contributor

Choose a reason for hiding this comment

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

Directly returning a map is more general.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want to guarantee that every entry is add by API StatististicBuilder.put(expr, columnStats). If the map is exposed, the guarantee may be broken.

for (Slot slot : olapScan.getOutput()) {
if (isVisibleSlotReference(slot)) {
ColumnStatistic cache = getColumnStatistic(olapTable, slot.getName(),
olapScan.getSelectedIndexIdForMV());
Copy link
Contributor

Choose a reason for hiding this comment

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

getSelectedIndexIdForMV() i think this is only used in statistic, so impl it in StatsCalculator.java, not in OlapScan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

analyze module also need this function

double rowCount = getSelectedPartitionRowCount(olapScan);
// if partition row count is not available, fallback to table stats
if (rowCount > 0) {
List<String> selectedPartitionNames = new ArrayList<>(olapScan.getSelectedPartitionIds().size());
Copy link
Contributor

Choose a reason for hiding this comment

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

use Lists.newArrayListWithExpectedSize() to avoid resize. because list will resize when filling rate more than a threshold

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is fixed size, no need to resize

@englefly
Copy link
Contributor Author

run external

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jun 26, 2024
@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@englefly englefly merged commit 29eab1a into apache:master Jun 26, 2024
@englefly englefly deleted the part-refactor branch June 26, 2024 11:54
dataroaring pushed a commit that referenced this pull request Jun 28, 2024
…contains rows from selected partitions (#36760)

1. update rowcount if some partitions are pruned
2. refactor StatsCalcualtor for Scan
morrySnow pushed a commit that referenced this pull request Dec 8, 2025
### What problem does this PR solve?

Related PR: 
#36760
#57850

Problem Summary:

Fix stats unknown when calc sync mv plan statistics

For SQLs that are related to statistics, we should not collect or
compute statistics. Previously this was determined by the `isInternal`
flag, but `isInternal` is too broad: it covers not only
statistics-related SQL but also SQL used to generate materialized view
plans. Materialized view plan generation requires statistics, so we
introduce a new flag `isPlanWithUnKnownColumnStats` to indicate
connections that are used for statistics-only operations (treat column
statistics as unknown).
github-actions bot pushed a commit that referenced this pull request Dec 8, 2025
### What problem does this PR solve?

Related PR: 
#36760
#57850

Problem Summary:

Fix stats unknown when calc sync mv plan statistics

For SQLs that are related to statistics, we should not collect or
compute statistics. Previously this was determined by the `isInternal`
flag, but `isInternal` is too broad: it covers not only
statistics-related SQL but also SQL used to generate materialized view
plans. Materialized view plan generation requires statistics, so we
introduce a new flag `isPlanWithUnKnownColumnStats` to indicate
connections that are used for statistics-only operations (treat column
statistics as unknown).
yiguolei pushed a commit that referenced this pull request Dec 11, 2025
### What problem does this PR solve?

Related PR: 
#36760
#57850

Problem Summary:

Fix stats unknown when calc sync mv plan statistics

For SQLs that are related to statistics, we should not collect or
compute statistics. Previously this was determined by the `isInternal`
flag, but `isInternal` is too broad: it covers not only
statistics-related SQL but also SQL used to generate materialized view
plans. Materialized view plan generation requires statistics, so we
introduce a new flag `isPlanWithUnKnownColumnStats` to indicate
connections that are used for statistics-only operations (treat column
statistics as unknown).
nagisa-kunhah pushed a commit to nagisa-kunhah/doris that referenced this pull request Dec 14, 2025
…#58426)

### What problem does this PR solve?

Related PR: 
apache#36760
apache#57850

Problem Summary:

Fix stats unknown when calc sync mv plan statistics

For SQLs that are related to statistics, we should not collect or
compute statistics. Previously this was determined by the `isInternal`
flag, but `isInternal` is too broad: it covers not only
statistics-related SQL but also SQL used to generate materialized view
plans. Materialized view plan generation requires statistics, so we
introduce a new flag `isPlanWithUnKnownColumnStats` to indicate
connections that are used for statistics-only operations (treat column
statistics as unknown).
yiguolei pushed a commit that referenced this pull request Dec 18, 2025
### What problem does this PR solve?

Related PR: 
#36760
#57850

Problem Summary:

Fix stats unknown when calc sync mv plan statistics

For SQLs that are related to statistics, we should not collect or
compute statistics. Previously this was determined by the `isInternal`
flag, but `isInternal` is too broad: it covers not only
statistics-related SQL but also SQL used to generate materialized view
plans. Materialized view plan generation requires statistics, so we
introduce a new flag `isPlanWithUnKnownColumnStats` to indicate
connections that are used for statistics-only operations (treat column
statistics as unknown).
seawinde added a commit to seawinde/doris that referenced this pull request Dec 22, 2025
…#58426)

### What problem does this PR solve?

Related PR: 
apache#36760
apache#57850

Problem Summary:

Fix stats unknown when calc sync mv plan statistics

For SQLs that are related to statistics, we should not collect or
compute statistics. Previously this was determined by the `isInternal`
flag, but `isInternal` is too broad: it covers not only
statistics-related SQL but also SQL used to generate materialized view
plans. Materialized view plan generation requires statistics, so we
introduce a new flag `isPlanWithUnKnownColumnStats` to indicate
connections that are used for statistics-only operations (treat column
statistics as unknown).
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/3.0.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants