Skip to content

Conversation

@924060929
Copy link
Contributor

@924060929 924060929 commented Aug 21, 2024

Proposed changes

support cache tablets aggregate result

for example

SQL 1:

select key, sum(value)
from tbl
where dt between '2024-08-01' and '2024-08-10'
group by key

SQL 2:

select key, sum(value)
from tbl
where dt between '2024-08-5' and '2024-08-15'
group by key

SQL 1 will update the tablets aggregate result which partition between '2024-08-01' and '2024-08-10'.
Then SQL 2 will reuse the tablets aggregate which partition between '2024-08-05' and '2024-08-10', and compute aggregate which partition between '2024-08-11' and '2024-08-15'

We only support simple aggregate which not contains join with runtime filter, at present.

How to use

set enable_query_cache=true;

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

@924060929
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@924060929 924060929 changed the title [feature](Nereids) Support cache partition aggregate result in fe [feature](Nereids) Support cache tablets aggregate result in fe Aug 21, 2024
@924060929 924060929 changed the title [feature](Nereids) Support cache tablets aggregate result in fe [feature](Nereids) Support cache tablets aggregate result (fe) Aug 21, 2024
@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18176	5155	4539	4539
q2	2557	207	218	207
q3	12265	1141	1130	1130
q4	11165	796	741	741
q5	8128	2928	2769	2769
q6	280	158	167	158
q7	1017	662	658	658
q8	9392	2088	2108	2088
q9	7388	6582	6596	6582
q10	7086	2211	2247	2211
q11	509	273	271	271
q12	441	269	268	268
q13	17799	3020	2993	2993
q14	306	264	265	264
q15	572	504	527	504
q16	544	407	411	407
q17	994	706	782	706
q18	7561	6985	6865	6865
q19	5623	1069	1061	1061
q20	705	354	332	332
q21	3855	2995	2952	2952
q22	1123	1028	1018	1018
Total cold run time: 117486 ms
Total hot run time: 38724 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4525	4252	4265	4252
q2	403	307	290	290
q3	2892	2628	2643	2628
q4	1961	1649	1687	1649
q5	5413	5417	5425	5417
q6	234	144	146	144
q7	2063	1724	1715	1715
q8	3256	3349	3373	3349
q9	8499	8400	8338	8338
q10	3390	3206	3197	3197
q11	613	526	527	526
q12	817	624	625	624
q13	17671	3018	3031	3018
q14	337	296	320	296
q15	570	518	539	518
q16	527	451	457	451
q17	1804	1540	1484	1484
q18	7732	7558	7355	7355
q19	1722	1728	1617	1617
q20	2045	1845	1812	1812
q21	8042	5216	5035	5035
q22	1142	1042	1051	1042
Total cold run time: 75658 ms
Total hot run time: 54757 ms

@doris-robot
Copy link

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

query1	986	403	388	388
query2	6730	1983	1973	1973
query3	6691	234	248	234
query4	31257	23328	23237	23237
query5	4402	726	725	725
query6	316	214	209	209
query7	4615	331	327	327
query8	481	434	449	434
query9	8610	2517	2502	2502
query10	518	355	350	350
query11	18198	15078	15111	15078
query12	188	142	137	137
query13	1731	456	473	456
query14	9688	7219	6818	6818
query15	306	195	188	188
query16	8116	498	509	498
query17	1597	619	599	599
query18	2186	351	338	338
query19	350	174	171	171
query20	142	135	136	135
query21	254	140	142	140
query22	4288	3964	3937	3937
query23	34226	33465	33361	33361
query24	11102	2897	2933	2897
query25	644	425	419	419
query26	1180	181	181	181
query27	2415	306	304	304
query28	7280	2117	2115	2115
query29	857	449	442	442
query30	337	185	185	185
query31	1046	815	836	815
query32	129	83	89	83
query33	809	354	337	337
query34	910	502	515	502
query35	893	766	758	758
query36	1130	939	930	930
query37	178	103	105	103
query38	4061	3887	3896	3887
query39	1517	1492	1494	1492
query40	238	155	154	154
query41	159	138	139	138
query42	135	119	123	119
query43	548	497	515	497
query44	1309	792	800	792
query45	232	201	198	198
query46	1122	787	761	761
query47	1913	1804	1841	1804
query48	403	343	333	333
query49	1253	574	572	572
query50	857	462	459	459
query51	7221	7110	7129	7110
query52	121	111	111	111
query53	297	230	229	229
query54	946	507	504	504
query55	91	90	89	89
query56	330	338	321	321
query57	1208	1142	1121	1121
query58	313	300	328	300
query59	3073	2747	2864	2747
query60	354	324	337	324
query61	153	148	148	148
query62	875	687	699	687
query63	258	227	225	225
query64	5299	2396	1835	1835
query65	3222	3179	3200	3179
query66	1155	726	663	663
query67	15831	14922	14891	14891
query68	6472	590	580	580
query69	687	427	353	353
query70	1228	1156	1170	1156
query71	565	313	317	313
query72	7650	2327	2104	2104
query73	856	358	356	356
query74	9118	8939	8808	8808
query75	4957	2758	2779	2758
query76	4750	1049	988	988
query77	895	480	434	434
query78	10885	9749	12558	9749
query79	7668	570	563	563
query80	986	618	613	613
query81	617	261	268	261
query82	367	166	167	166
query83	386	217	212	212
query84	296	97	98	97
query85	828	370	353	353
query86	482	328	311	311
query87	4592	4246	4290	4246
query88	3700	2559	2508	2508
query89	429	337	329	329
query90	2032	243	275	243
query91	175	131	127	127
query92	102	81	76	76
query93	1196	568	559	559
query94	862	332	330	330
query95	402	297	303	297
query96	596	290	288	288
query97	3288	3029	3077	3029
query98	254	234	232	232
query99	1709	1336	1297	1297
Total cold run time: 308310 ms
Total hot run time: 191732 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.04
query2	0.09	0.04	0.04
query3	0.23	0.05	0.05
query4	1.67	0.08	0.07
query5	0.51	0.50	0.51
query6	1.14	0.73	0.74
query7	0.02	0.01	0.01
query8	0.05	0.05	0.05
query9	0.57	0.50	0.51
query10	0.55	0.56	0.55
query11	0.16	0.12	0.12
query12	0.16	0.14	0.13
query13	0.60	0.60	0.59
query14	0.76	0.79	0.81
query15	0.89	0.82	0.82
query16	0.37	0.38	0.36
query17	0.98	0.99	1.01
query18	0.22	0.21	0.20
query19	1.79	1.73	1.79
query20	0.01	0.01	0.02
query21	15.39	0.66	0.66
query22	4.16	7.05	2.46
query23	18.28	1.42	1.34
query24	2.09	0.23	0.21
query25	0.17	0.09	0.09
query26	0.28	0.18	0.17
query27	0.09	0.09	0.08
query28	13.29	1.03	1.02
query29	12.71	3.39	3.41
query30	0.44	0.25	0.24
query31	2.81	0.41	0.40
query32	3.24	0.48	0.49
query33	2.98	2.99	2.99
query34	17.27	4.34	4.36
query35	4.41	4.46	4.52
query36	0.68	0.49	0.48
query37	0.22	0.18	0.19
query38	0.18	0.17	0.17
query39	0.06	0.06	0.06
query40	0.19	0.15	0.16
query41	0.12	0.07	0.07
query42	0.08	0.07	0.06
query43	0.07	0.07	0.07
Total cold run time: 110.03 s
Total hot run time: 31.85 s

5: optional list<Types.TPrimitiveType> key_column_types
6: optional string rollup_name
7: optional string sort_column
8: optional list<string> select_columns
Copy link
Contributor

@starocean999 starocean999 Aug 21, 2024

Choose a reason for hiding this comment

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

there is no remapped_slot_ids, plz check if we need it or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think remapped_slot_ids is needed.
The select_columns contains this information and ignore select column order

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@924060929
Copy link
Contributor Author

run buildall

1 similar comment
@924060929
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@924060929
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@924060929
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18066	4494	4368	4368
q2	2027	195	185	185
q3	11944	989	1151	989
q4	10489	733	745	733
q5	7791	2876	2857	2857
q6	226	138	137	137
q7	958	622	604	604
q8	9338	2093	2090	2090
q9	7224	6544	6572	6544
q10	7005	2173	2211	2173
q11	465	241	241	241
q12	394	230	231	230
q13	17756	3083	3031	3031
q14	295	244	239	239
q15	513	488	480	480
q16	491	393	392	392
q17	1006	771	731	731
q18	7554	6859	6942	6859
q19	1391	996	981	981
q20	681	333	345	333
q21	4050	3260	3004	3004
q22	1128	1036	1059	1036
Total cold run time: 110792 ms
Total hot run time: 38237 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4349	4316	4285	4285
q2	373	275	269	269
q3	2927	2663	2636	2636
q4	1965	1684	1694	1684
q5	5687	5728	5825	5728
q6	228	137	140	137
q7	2213	1843	1859	1843
q8	3290	3527	3540	3527
q9	8902	8900	8847	8847
q10	3597	3415	3387	3387
q11	612	504	520	504
q12	828	652	650	650
q13	14593	3151	3259	3151
q14	316	302	282	282
q15	536	509	486	486
q16	490	453	444	444
q17	1830	1520	1531	1520
q18	8187	7788	7908	7788
q19	1747	1444	1679	1444
q20	2157	1901	1868	1868
q21	5681	5549	5621	5549
q22	1146	1075	1069	1069
Total cold run time: 71654 ms
Total hot run time: 57098 ms

@doris-robot
Copy link

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

query1	1271	868	886	868
query2	6349	1948	1880	1880
query3	10731	4171	4121	4121
query4	60094	26757	23131	23131
query5	5323	493	485	485
query6	413	160	172	160
query7	5763	305	301	301
query8	292	211	211	211
query9	8864	2498	2474	2474
query10	504	289	250	250
query11	18299	14977	15270	14977
query12	163	103	104	103
query13	1575	393	397	393
query14	10859	7344	7031	7031
query15	232	178	173	173
query16	7540	467	481	467
query17	1110	591	611	591
query18	2027	322	308	308
query19	310	159	156	156
query20	125	117	114	114
query21	212	105	103	103
query22	4666	4477	4459	4459
query23	34760	33440	33490	33440
query24	5951	2868	2832	2832
query25	559	403	401	401
query26	692	159	160	159
query27	1788	281	279	279
query28	3709	2062	2045	2045
query29	704	425	426	425
query30	240	162	157	157
query31	924	780	816	780
query32	86	55	51	51
query33	454	283	267	267
query34	842	470	474	470
query35	846	707	710	707
query36	1098	953	920	920
query37	145	83	81	81
query38	3974	3964	3951	3951
query39	1441	1403	1419	1403
query40	195	115	110	110
query41	47	46	45	45
query42	120	97	97	97
query43	504	468	462	462
query44	1095	738	735	735
query45	200	175	170	170
query46	1088	720	741	720
query47	1906	1790	1825	1790
query48	377	301	296	296
query49	784	422	435	422
query50	825	413	407	407
query51	7197	7035	7125	7035
query52	96	88	90	88
query53	251	176	178	176
query54	547	445	445	445
query55	77	74	83	74
query56	264	252	246	246
query57	1203	1100	1049	1049
query58	218	218	224	218
query59	3027	2715	2727	2715
query60	287	271	268	268
query61	107	101	103	101
query62	768	669	635	635
query63	213	179	182	179
query64	4222	2248	1707	1707
query65	3179	3182	3106	3106
query66	671	329	326	326
query67	15624	15316	15453	15316
query68	3032	556	558	556
query69	391	272	272	272
query70	1120	1107	1123	1107
query71	372	271	267	267
query72	2727	2074	2133	2074
query73	715	324	323	323
query74	9154	8708	8810	8708
query75	3363	2702	2725	2702
query76	1449	950	1023	950
query77	532	312	334	312
query78	9539	9183	9064	9064
query79	1029	540	533	533
query80	712	520	490	490
query81	508	227	229	227
query82	297	136	136	136
query83	171	149	150	149
query84	259	81	77	77
query85	676	284	290	284
query86	307	274	302	274
query87	4402	4427	4274	4274
query88	3043	2285	2307	2285
query89	373	288	287	287
query90	1942	196	193	193
query91	122	99	97	97
query92	62	52	54	52
query93	1046	536	537	536
query94	731	297	300	297
query95	361	332	261	261
query96	583	262	272	262
query97	3231	3092	3070	3070
query98	220	209	208	208
query99	1512	1278	1251	1251
Total cold run time: 304008 ms
Total hot run time: 191640 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.04
query2	0.08	0.04	0.04
query3	0.22	0.06	0.05
query4	1.66	0.09	0.08
query5	0.51	0.52	0.54
query6	1.13	0.73	0.73
query7	0.01	0.01	0.01
query8	0.06	0.05	0.05
query9	0.55	0.50	0.49
query10	0.54	0.55	0.54
query11	0.15	0.12	0.12
query12	0.15	0.12	0.12
query13	0.62	0.59	0.57
query14	0.76	0.80	0.79
query15	0.85	0.81	0.82
query16	0.37	0.38	0.39
query17	1.05	1.06	1.05
query18	0.22	0.21	0.21
query19	1.90	1.88	1.78
query20	0.02	0.01	0.01
query21	15.40	0.67	0.67
query22	4.30	7.48	1.87
query23	18.29	1.39	1.33
query24	2.13	0.23	0.22
query25	0.15	0.08	0.08
query26	0.26	0.19	0.19
query27	0.08	0.07	0.08
query28	13.28	1.02	1.00
query29	12.64	3.35	3.33
query30	0.26	0.06	0.05
query31	2.85	0.41	0.41
query32	3.24	0.48	0.48
query33	3.00	3.00	3.05
query34	17.00	4.40	4.48
query35	4.49	4.47	4.49
query36	0.66	0.49	0.48
query37	0.19	0.16	0.16
query38	0.15	0.15	0.16
query39	0.04	0.03	0.03
query40	0.16	0.13	0.13
query41	0.10	0.05	0.05
query42	0.06	0.05	0.05
query43	0.04	0.04	0.04
Total cold run time: 109.67 s
Total hot run time: 31.05 s

@924060929
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18240	4640	4478	4478
q2	2549	179	204	179
q3	11107	1160	1138	1138
q4	10303	727	811	727
q5	8352	2985	2892	2892
q6	243	147	162	147
q7	1009	654	621	621
q8	9507	2095	2114	2095
q9	7026	6607	6603	6603
q10	7010	2251	2235	2235
q11	461	242	252	242
q12	409	230	231	230
q13	19012	3042	3020	3020
q14	287	240	237	237
q15	523	488	504	488
q16	484	404	386	386
q17	1004	666	670	666
q18	7573	6892	6847	6847
q19	1403	1128	1058	1058
q20	694	348	341	341
q21	3988	3120	3055	3055
q22	1160	1020	1018	1018
Total cold run time: 112344 ms
Total hot run time: 38703 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4432	4375	4302	4302
q2	373	278	270	270
q3	2924	2646	2726	2646
q4	1944	1663	1668	1663
q5	5397	5461	5459	5459
q6	229	137	137	137
q7	2146	1725	1760	1725
q8	3235	3416	3414	3414
q9	8518	8439	8432	8432
q10	3473	3211	3194	3194
q11	581	485	495	485
q12	816	618	617	617
q13	11970	3042	3114	3042
q14	318	292	269	269
q15	527	475	480	475
q16	484	432	412	412
q17	1793	1509	1478	1478
q18	7851	7415	7475	7415
q19	1688	1675	1574	1574
q20	2035	1830	1805	1805
q21	5421	5266	5220	5220
q22	1127	1087	1051	1051
Total cold run time: 67282 ms
Total hot run time: 55085 ms

@doris-robot
Copy link

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

query1	917	380	365	365
query2	6474	1979	1779	1779
query3	6641	214	223	214
query4	34214	23179	23420	23179
query5	4161	516	495	495
query6	261	163	179	163
query7	4568	293	290	290
query8	264	213	206	206
query9	8446	2526	2501	2501
query10	442	266	255	255
query11	17822	14943	14893	14893
query12	151	104	97	97
query13	1617	388	377	377
query14	9985	7267	6638	6638
query15	233	173	180	173
query16	7748	462	477	462
query17	1594	597	565	565
query18	1510	302	296	296
query19	210	151	155	151
query20	122	111	111	111
query21	216	104	127	104
query22	4583	4081	4037	4037
query23	34127	33427	33566	33427
query24	11076	2884	2880	2880
query25	616	392	407	392
query26	1299	158	159	158
query27	2761	280	276	276
query28	7407	2071	2065	2065
query29	818	418	404	404
query30	309	159	150	150
query31	985	795	750	750
query32	97	55	56	55
query33	768	291	302	291
query34	961	475	481	475
query35	856	767	692	692
query36	1091	928	950	928
query37	142	82	87	82
query38	4008	3733	3852	3733
query39	1455	1399	1400	1399
query40	273	120	117	117
query41	50	46	47	46
query42	120	98	101	98
query43	503	473	464	464
query44	1254	745	757	745
query45	211	169	166	166
query46	1109	734	728	728
query47	1874	1749	1800	1749
query48	383	290	294	290
query49	1095	428	425	425
query50	817	422	414	414
query51	7098	7076	7055	7055
query52	100	91	90	90
query53	255	181	177	177
query54	923	444	446	444
query55	80	76	84	76
query56	278	260	264	260
query57	1169	1046	1084	1046
query58	234	220	253	220
query59	3090	2859	2665	2665
query60	298	272	263	263
query61	101	100	101	100
query62	828	665	656	656
query63	223	185	181	181
query64	5819	2383	1739	1739
query65	3253	3172	3110	3110
query66	1282	339	345	339
query67	15556	15158	15209	15158
query68	4095	545	564	545
query69	411	275	285	275
query70	1101	1030	1145	1030
query71	336	275	274	274
query72	6316	2299	2051	2051
query73	756	322	323	322
query74	9059	8845	8882	8845
query75	3419	2705	2759	2705
query76	2488	982	1033	982
query77	464	333	341	333
query78	10643	9148	9388	9148
query79	1044	546	536	536
query80	697	505	491	491
query81	448	235	226	226
query82	229	138	141	138
query83	175	159	155	155
query84	226	82	80	80
query85	681	275	280	275
query86	317	310	300	300
query87	4314	4419	4295	4295
query88	2924	2320	2322	2320
query89	376	292	296	292
query90	1870	200	201	200
query91	196	98	100	98
query92	62	50	51	50
query93	1049	548	546	546
query94	758	301	311	301
query95	370	267	271	267
query96	594	272	277	272
query97	3245	3099	3036	3036
query98	216	219	202	202
query99	1447	1261	1291	1261
Total cold run time: 289557 ms
Total hot run time: 186180 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.04
query2	0.08	0.04	0.04
query3	0.22	0.05	0.05
query4	1.67	0.09	0.09
query5	0.51	0.49	0.51
query6	1.13	0.71	0.72
query7	0.02	0.02	0.01
query8	0.05	0.04	0.04
query9	0.56	0.49	0.49
query10	0.54	0.52	0.54
query11	0.16	0.12	0.12
query12	0.16	0.13	0.12
query13	0.61	0.58	0.58
query14	0.77	0.78	0.78
query15	0.91	0.81	0.81
query16	0.36	0.37	0.41
query17	1.05	1.05	1.04
query18	0.21	0.20	0.20
query19	1.88	1.75	1.88
query20	0.02	0.01	0.01
query21	15.40	0.66	0.66
query22	4.19	7.56	1.72
query23	18.27	1.36	1.34
query24	2.22	0.22	0.21
query25	0.15	0.08	0.08
query26	0.28	0.17	0.17
query27	0.07	0.08	0.08
query28	13.19	1.03	1.00
query29	12.59	3.40	3.35
query30	0.26	0.06	0.05
query31	2.86	0.40	0.40
query32	3.24	0.48	0.47
query33	2.98	3.00	3.05
query34	16.95	4.43	4.40
query35	4.51	4.53	4.51
query36	0.66	0.49	0.52
query37	0.18	0.16	0.16
query38	0.16	0.16	0.16
query39	0.05	0.04	0.04
query40	0.17	0.13	0.14
query41	0.09	0.04	0.05
query42	0.06	0.04	0.05
query43	0.05	0.04	0.04
Total cold run time: 109.54 s
Total hot run time: 30.8 s

@924060929
Copy link
Contributor Author

run buildall

@924060929
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18568	6049	4454	4454
q2	2809	186	186	186
q3	11207	1147	1107	1107
q4	11160	754	726	726
q5	7913	2924	2882	2882
q6	236	155	144	144
q7	981	630	618	618
q8	9462	2087	2092	2087
q9	7178	6501	6545	6501
q10	7005	2255	2258	2255
q11	466	233	248	233
q12	407	229	227	227
q13	17781	3018	3067	3018
q14	277	241	236	236
q15	521	494	496	494
q16	574	519	502	502
q17	983	664	617	617
q18	7351	6987	6798	6798
q19	1455	1098	1117	1098
q20	674	342	328	328
q21	3948	2902	2956	2902
q22	1119	1011	1033	1011
Total cold run time: 112075 ms
Total hot run time: 38424 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4388	4269	4279	4269
q2	385	266	262	262
q3	2907	2645	2680	2645
q4	1927	1619	1687	1619
q5	5394	5381	5410	5381
q6	224	131	130	130
q7	2080	1729	1731	1729
q8	3188	3376	3375	3375
q9	8456	8395	8384	8384
q10	3473	3229	3198	3198
q11	605	509	505	505
q12	786	601	634	601
q13	10161	3028	3005	3005
q14	314	271	269	269
q15	520	483	488	483
q16	641	557	577	557
q17	1795	1472	1467	1467
q18	7685	7401	7490	7401
q19	1689	1369	1604	1369
q20	2096	1803	1852	1803
q21	5485	5252	5324	5252
q22	1123	1045	1037	1037
Total cold run time: 65322 ms
Total hot run time: 54741 ms

@doris-robot
Copy link

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

query1	916	377	371	371
query2	6463	1963	1946	1946
query3	6650	217	239	217
query4	33570	23260	23106	23106
query5	4174	513	500	500
query6	261	165	184	165
query7	4582	303	289	289
query8	255	212	212	212
query9	8477	2519	2517	2517
query10	445	307	276	276
query11	17864	14961	15134	14961
query12	150	102	98	98
query13	1635	390	377	377
query14	9504	7154	7314	7154
query15	260	167	181	167
query16	8092	437	454	437
query17	1578	563	536	536
query18	2126	299	282	282
query19	284	142	141	141
query20	121	113	112	112
query21	215	110	107	107
query22	4487	4220	4025	4025
query23	33994	33380	34855	33380
query24	12219	2916	2904	2904
query25	524	394	394	394
query26	990	157	156	156
query27	2829	289	281	281
query28	7642	2129	2104	2104
query29	642	422	422	422
query30	307	157	149	149
query31	989	756	781	756
query32	97	55	63	55
query33	758	287	292	287
query34	972	488	501	488
query35	888	749	734	734
query36	1083	934	950	934
query37	150	95	90	90
query38	3993	3793	3819	3793
query39	1457	1389	1389	1389
query40	274	121	122	121
query41	50	47	44	44
query42	117	99	105	99
query43	531	477	506	477
query44	1239	762	750	750
query45	199	169	167	167
query46	1127	759	742	742
query47	1890	1779	1827	1779
query48	363	289	292	289
query49	1130	433	424	424
query50	812	431	424	424
query51	7216	7046	7075	7046
query52	96	88	89	88
query53	259	189	188	188
query54	901	467	458	458
query55	82	75	78	75
query56	278	253	257	253
query57	1191	1067	1071	1067
query58	251	252	227	227
query59	3048	2847	2697	2697
query60	287	268	262	262
query61	99	95	96	95
query62	834	659	670	659
query63	223	191	191	191
query64	5057	666	690	666
query65	3222	3144	3189	3144
query66	1290	345	393	345
query67	15535	15402	15359	15359
query68	3582	586	583	583
query69	402	284	284	284
query70	1209	1079	1139	1079
query71	337	282	271	271
query72	6001	4075	4008	4008
query73	762	331	339	331
query74	9162	8804	8898	8804
query75	3419	2645	2670	2645
query76	2295	976	959	959
query77	514	322	331	322
query78	10295	8996	9049	8996
query79	1039	550	541	541
query80	691	507	502	502
query81	453	238	235	235
query82	253	145	146	145
query83	172	154	151	151
query84	230	78	77	77
query85	678	347	405	347
query86	305	287	301	287
query87	4439	4285	4266	4266
query88	2949	2369	2375	2369
query89	387	300	298	298
query90	1846	198	194	194
query91	123	116	101	101
query92	62	52	53	52
query93	1034	565	554	554
query94	550	276	293	276
query95	358	274	266	266
query96	591	278	275	275
query97	3229	3069	3089	3069
query98	215	209	203	203
query99	1483	1358	1286	1286
Total cold run time: 288309 ms
Total hot run time: 188224 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.04
query2	0.08	0.04	0.04
query3	0.22	0.05	0.05
query4	1.67	0.07	0.08
query5	0.53	0.49	0.51
query6	1.14	0.73	0.73
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.56	0.47	0.48
query10	0.54	0.53	0.55
query11	0.16	0.13	0.12
query12	0.14	0.12	0.12
query13	0.60	0.58	0.58
query14	2.07	2.06	2.08
query15	0.91	0.84	0.81
query16	0.38	0.38	0.35
query17	0.97	0.96	0.99
query18	0.22	0.20	0.22
query19	1.79	1.79	1.67
query20	0.01	0.01	0.01
query21	15.41	0.68	0.67
query22	4.58	6.29	2.02
query23	18.30	1.48	1.27
query24	2.09	0.23	0.23
query25	0.14	0.09	0.08
query26	0.27	0.17	0.18
query27	0.08	0.07	0.07
query28	13.24	1.02	1.00
query29	12.57	3.35	3.35
query30	0.25	0.06	0.06
query31	2.87	0.43	0.39
query32	3.23	0.48	0.50
query33	3.00	2.96	3.01
query34	17.01	4.40	4.36
query35	4.46	4.47	4.50
query36	0.67	0.48	0.48
query37	0.19	0.16	0.16
query38	0.15	0.15	0.15
query39	0.05	0.04	0.04
query40	0.16	0.13	0.12
query41	0.09	0.05	0.06
query42	0.07	0.05	0.04
query43	0.05	0.04	0.04
Total cold run time: 111.04 s
Total hot run time: 32.02 s

@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2024

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2024

clang-tidy review says "All clean, LGTM! 👍"

@924060929
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2024

clang-tidy review says "All clean, LGTM! 👍"

@morrySnow morrySnow changed the title [feature](Nereids) Support cache tablets aggregate result (fe) [feature-WIP](query cache) cache tablets aggregate result, FE part Sep 5, 2024
@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18048	5485	4429	4429
q2	2210	188	185	185
q3	10538	1185	1207	1185
q4	10151	782	822	782
q5	7718	2900	2839	2839
q6	225	139	145	139
q7	964	625	628	625
q8	9325	2133	2055	2055
q9	7043	6552	6495	6495
q10	7011	2238	2235	2235
q11	450	245	250	245
q12	402	237	231	231
q13	18860	3085	3107	3085
q14	294	241	249	241
q15	531	488	496	488
q16	600	513	514	513
q17	1017	725	692	692
q18	7635	6889	7026	6889
q19	1385	989	952	952
q20	685	338	335	335
q21	4036	3039	2885	2885
q22	1123	1014	1011	1011
Total cold run time: 110251 ms
Total hot run time: 38536 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4366	4309	4310	4309
q2	380	293	285	285
q3	2926	2620	2667	2620
q4	1938	1620	1715	1620
q5	5421	5438	5501	5438
q6	231	133	134	133
q7	2126	1740	1718	1718
q8	3216	3399	3384	3384
q9	8488	8470	8447	8447
q10	3445	3211	3165	3165
q11	591	498	500	498
q12	784	610	623	610
q13	11669	3134	3085	3085
q14	299	270	289	270
q15	518	484	488	484
q16	641	571	542	542
q17	1809	1504	1479	1479
q18	7873	7535	7533	7533
q19	1658	1617	1533	1533
q20	2080	1810	1809	1809
q21	5376	5474	5220	5220
q22	1103	1018	1054	1018
Total cold run time: 66938 ms
Total hot run time: 55200 ms

@doris-robot
Copy link

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

query1	910	381	374	374
query2	6507	2075	2072	2072
query3	6647	211	216	211
query4	33701	23224	23356	23224
query5	4199	516	504	504
query6	265	181	164	164
query7	4579	289	302	289
query8	272	233	215	215
query9	8419	2515	2500	2500
query10	439	280	270	270
query11	17707	15039	15086	15039
query12	159	103	104	103
query13	1653	387	381	381
query14	9787	7088	6874	6874
query15	235	168	163	163
query16	7687	475	460	460
query17	1583	571	536	536
query18	1367	292	283	283
query19	199	146	143	143
query20	119	108	107	107
query21	211	105	103	103
query22	4394	4341	4149	4149
query23	34146	33387	33462	33387
query24	11128	2885	2926	2885
query25	624	413	404	404
query26	1060	167	163	163
query27	2712	291	285	285
query28	7390	2112	2067	2067
query29	723	429	432	429
query30	311	161	150	150
query31	1004	753	777	753
query32	102	63	55	55
query33	768	305	302	302
query34	941	495	492	492
query35	869	755	744	744
query36	1097	948	959	948
query37	146	93	94	93
query38	4065	3829	3927	3829
query39	1461	1410	1394	1394
query40	206	119	118	118
query41	51	48	50	48
query42	115	97	98	97
query43	517	490	495	490
query44	1176	765	747	747
query45	196	169	173	169
query46	1099	737	779	737
query47	1878	1827	1820	1820
query48	392	308	319	308
query49	1108	451	474	451
query50	826	414	419	414
query51	6940	6926	6895	6895
query52	105	90	90	90
query53	260	185	186	185
query54	1036	467	473	467
query55	83	79	79	79
query56	292	281	275	275
query57	1207	1094	1087	1087
query58	254	237	240	237
query59	3016	2820	2892	2820
query60	309	283	299	283
query61	130	126	120	120
query62	830	660	636	636
query63	224	201	189	189
query64	5366	838	648	648
query65	3235	3144	3148	3144
query66	1267	345	351	345
query67	15737	15200	15346	15200
query68	4585	565	560	560
query69	414	273	270	270
query70	1160	1077	1072	1072
query71	347	278	274	274
query72	6844	4063	3993	3993
query73	759	334	333	333
query74	9169	8769	8750	8750
query75	3395	2663	2702	2663
query76	2587	1036	989	989
query77	509	320	322	320
query78	11344	9547	9012	9012
query79	1144	534	537	534
query80	944	517	517	517
query81	587	237	234	234
query82	655	147	151	147
query83	230	147	151	147
query84	274	78	78	78
query85	718	280	273	273
query86	367	264	281	264
query87	4482	4230	4282	4230
query88	2917	2371	2378	2371
query89	391	284	284	284
query90	1836	197	196	196
query91	129	101	104	101
query92	60	48	51	48
query93	1086	571	546	546
query94	795	342	303	303
query95	353	264	263	263
query96	613	267	277	267
query97	3192	3064	3121	3064
query98	215	199	197	197
query99	1604	1304	1263	1263
Total cold run time: 291146 ms
Total hot run time: 188206 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.04
query2	0.08	0.04	0.03
query3	0.23	0.05	0.05
query4	1.67	0.07	0.07
query5	0.51	0.49	0.50
query6	1.13	0.73	0.73
query7	0.01	0.01	0.01
query8	0.06	0.04	0.04
query9	0.54	0.50	0.50
query10	0.55	0.57	0.54
query11	0.16	0.12	0.12
query12	0.15	0.14	0.11
query13	0.61	0.60	0.59
query14	2.04	2.06	2.07
query15	0.84	0.82	0.82
query16	0.37	0.38	0.37
query17	0.97	1.04	1.08
query18	0.21	0.20	0.20
query19	1.84	1.76	1.81
query20	0.01	0.01	0.01
query21	15.40	0.66	0.66
query22	4.32	7.29	1.94
query23	18.32	1.31	1.33
query24	2.09	0.22	0.20
query25	0.14	0.08	0.07
query26	0.26	0.18	0.17
query27	0.09	0.08	0.08
query28	13.27	1.02	1.00
query29	12.58	3.26	3.22
query30	0.24	0.05	0.06
query31	2.88	0.40	0.39
query32	3.25	0.47	0.48
query33	2.98	3.02	2.99
query34	17.01	4.32	4.33
query35	4.38	4.40	4.36
query36	0.66	0.48	0.48
query37	0.20	0.15	0.15
query38	0.15	0.15	0.15
query39	0.04	0.04	0.04
query40	0.16	0.12	0.13
query41	0.09	0.05	0.06
query42	0.06	0.05	0.05
query43	0.04	0.04	0.04
Total cold run time: 110.64 s
Total hot run time: 31.89 s

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2024

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

@github-actions github-actions bot added approved Indicates a PR has been approved by one committer. reviewed labels Sep 5, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2024

PR approved by anyone and no changes requested.

@starocean999 starocean999 merged commit d03f017 into apache:master Sep 5, 2024
dataroaring pushed a commit that referenced this pull request Oct 9, 2024
…39670)

# Proposed changes

support cache tablets aggregate result

for example

SQL 1:
```sql
select key, sum(value)
from tbl
where dt between '2024-08-01' and '2024-08-10'
group by key
```

SQL 2:
```sql
select key, sum(value)
from tbl
where dt between '2024-08-5' and '2024-08-15'
group by key
```

SQL 1 will update the tablets aggregate result which partition between
'2024-08-01' and '2024-08-10'.
Then SQL 2 will reuse the tablets aggregate which partition between
'2024-08-05' and '2024-08-10', and compute aggregate which partition
between '2024-08-11' and '2024-08-15'

We only support simple aggregate which not contains join with runtime
filter, at present.

# How to use

```sql
set enable_query_cache=true;
```
@924060929 924060929 deleted the query_cache_in_fe branch March 29, 2025 10:59
morrySnow pushed a commit that referenced this pull request Sep 16, 2025
…add ut test (#52601)

### What problem does this PR solve?

1. Nereids Translate Time should be after method
`PhysicalPlanTranslator#translatePlan`
2. fix 2.1 and 3.0 `Parse SQL Time` and `Nereids Lock Table Time` has
the same parseSqlStartTime.

Related PR: #39670 #45679
seawinde added a commit to seawinde/doris that referenced this pull request Nov 19, 2025
…add ut test (apache#52601)

1. Nereids Translate Time should be after method
`PhysicalPlanTranslator#translatePlan`
2. fix 2.1 and 3.0 `Parse SQL Time` and `Nereids Lock Table Time` has
the same parseSqlStartTime.

Related PR: apache#39670 apache#45679
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.3-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants