Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor](statistic) fetch statistic data with catalog and database id #33928

Merged
merged 3 commits into from
Apr 22, 2024

Conversation

morningman
Copy link
Contributor

@morningman morningman commented Apr 20, 2024

Proposed changes

In previously, all statistic tables have a column named id.
This column is combined with tableId and indexId.
Because table's id is unique globally, so we can query statistic table by only id
to fetch the table's statistic data.

By for external table, the table's id may not be unique globally. For example, the table id
may only be unique within a database. So we need more predicates to fetch the right statistic data.

In this PR, I changed all query statements of statistic table, by adding catalog_id and database_id conditions.
For example:

SELECT * FROM 
column_statistics
WHERE `id` = '${id}' AND `catalog_id` = '${catalogId}' AND `db_id` = '${dbId}'

The content of id column in statistic tables remain unchanged, so that after user upgrade Doris,
the existing statistic data can still be used.

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

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

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17617	4332	4254	4254
q2	2001	189	181	181
q3	10467	1114	1185	1114
q4	10194	725	722	722
q5	7503	2666	2603	2603
q6	219	131	137	131
q7	1000	603	588	588
q8	9226	2040	2040	2040
q9	7339	6571	6506	6506
q10	8468	3505	3501	3501
q11	468	235	227	227
q12	495	222	207	207
q13	17778	2979	2931	2931
q14	259	229	227	227
q15	533	490	486	486
q16	524	374	380	374
q17	954	681	653	653
q18	7307	6774	6636	6636
q19	6297	1536	1521	1521
q20	645	312	299	299
q21	3454	2784	2852	2784
q22	366	305	304	304
Total cold run time: 113114 ms
Total hot run time: 38289 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4330	4225	4242	4225
q2	370	263	260	260
q3	2991	2681	2724	2681
q4	1871	1592	1550	1550
q5	5331	5327	5265	5265
q6	207	124	123	123
q7	2227	1851	1826	1826
q8	3181	3352	3309	3309
q9	8537	8548	8473	8473
q10	4050	3831	3865	3831
q11	639	518	509	509
q12	805	650	620	620
q13	17943	3130	3095	3095
q14	338	294	290	290
q15	527	486	511	486
q16	532	441	456	441
q17	1790	1530	1481	1481
q18	8028	7850	7838	7838
q19	1655	1566	1606	1566
q20	2079	1893	1812	1812
q21	5246	4999	4936	4936
q22	546	466	481	466
Total cold run time: 73223 ms
Total hot run time: 55083 ms

@doris-robot
Copy link

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

query1	877	374	365	365
query2	6686	2594	2330	2330
query3	6643	209	198	198
query4	22932	21239	21225	21225
query5	4191	406	404	404
query6	276	204	176	176
query7	4577	296	283	283
query8	243	196	200	196
query9	8725	2307	2293	2293
query10	421	235	238	235
query11	14658	14165	14199	14165
query12	131	88	84	84
query13	1625	356	368	356
query14	8570	7797	7287	7287
query15	270	173	183	173
query16	8075	254	247	247
query17	1946	571	547	547
query18	2047	281	262	262
query19	206	158	149	149
query20	89	84	89	84
query21	204	126	122	122
query22	4966	4849	4849	4849
query23	33511	33036	33136	33036
query24	10921	3071	2999	2999
query25	624	380	384	380
query26	742	164	157	157
query27	2469	373	389	373
query28	6225	2075	2054	2054
query29	891	622	608	608
query30	283	175	194	175
query31	1029	786	780	780
query32	101	50	55	50
query33	774	251	249	249
query34	1218	500	488	488
query35	847	705	720	705
query36	1110	940	928	928
query37	113	71	75	71
query38	3434	3325	3371	3325
query39	1645	1570	1566	1566
query40	178	124	126	124
query41	46	42	42	42
query42	102	95	99	95
query43	577	550	559	550
query44	1242	740	732	732
query45	305	261	270	261
query46	1099	744	734	734
query47	2050	1927	1986	1927
query48	380	303	295	295
query49	837	405	401	401
query50	793	378	388	378
query51	6905	6861	6708	6708
query52	99	87	89	87
query53	335	272	274	272
query54	319	225	229	225
query55	77	73	84	73
query56	233	218	217	217
query57	1239	1142	1149	1142
query58	238	199	214	199
query59	3423	3141	3132	3132
query60	268	239	264	239
query61	111	103	102	102
query62	597	457	444	444
query63	309	283	279	279
query64	5329	4135	4033	4033
query65	3106	3005	3016	3005
query66	752	331	341	331
query67	15362	15080	15660	15080
query68	6634	545	537	537
query69	542	302	304	302
query70	1246	1189	1181	1181
query71	1482	1273	1269	1269
query72	6545	2736	2553	2553
query73	734	323	318	318
query74	6853	6383	6532	6383
query75	3958	2670	2577	2577
query76	4558	1039	1003	1003
query77	585	269	262	262
query78	10977	10246	10221	10221
query79	10094	516	510	510
query80	1703	455	450	450
query81	523	250	247	247
query82	795	97	93	93
query83	199	167	168	167
query84	273	86	85	85
query85	1294	331	398	331
query86	441	276	280	276
query87	3480	3276	3235	3235
query88	5187	2296	2324	2296
query89	522	380	371	371
query90	1861	179	178	178
query91	122	93	95	93
query92	57	44	46	44
query93	6971	494	495	494
query94	1008	173	171	171
query95	386	286	295	286
query96	602	262	258	258
query97	3116	2943	2909	2909
query98	234	216	215	215
query99	1241	890	841	841
Total cold run time: 294829 ms
Total hot run time: 185237 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.08	0.04	0.04
query3	0.23	0.05	0.05
query4	1.68	0.07	0.07
query5	0.49	0.49	0.51
query6	1.48	0.73	0.72
query7	0.02	0.01	0.01
query8	0.05	0.04	0.04
query9	0.55	0.49	0.49
query10	0.55	0.56	0.56
query11	0.16	0.12	0.11
query12	0.14	0.12	0.12
query13	0.59	0.58	0.58
query14	0.76	0.76	0.76
query15	0.82	0.80	0.80
query16	0.38	0.36	0.36
query17	0.96	0.95	1.03
query18	0.21	0.25	0.24
query19	1.83	1.65	1.80
query20	0.01	0.01	0.02
query21	15.48	0.64	0.63
query22	4.88	6.82	1.92
query23	18.31	1.35	1.26
query24	1.76	0.28	0.22
query25	0.15	0.08	0.08
query26	0.25	0.16	0.16
query27	0.08	0.07	0.08
query28	13.30	0.99	0.98
query29	12.59	3.33	3.36
query30	0.26	0.06	0.05
query31	2.86	0.39	0.37
query32	3.27	0.45	0.46
query33	2.80	2.84	2.77
query34	17.22	4.40	4.40
query35	4.50	4.50	4.51
query36	0.65	0.45	0.46
query37	0.18	0.15	0.15
query38	0.15	0.13	0.15
query39	0.04	0.04	0.03
query40	0.18	0.14	0.13
query41	0.09	0.05	0.05
query42	0.05	0.05	0.05
query43	0.04	0.04	0.03
Total cold run time: 110.12 s
Total hot run time: 30.29 s

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17618	4369	4250	4250
q2	2011	188	181	181
q3	10453	1151	1170	1151
q4	10190	751	795	751
q5	7503	2718	2658	2658
q6	218	137	132	132
q7	1032	597	592	592
q8	9240	2050	2050	2050
q9	7556	6624	6518	6518
q10	8554	3492	3500	3492
q11	446	232	229	229
q12	459	229	222	222
q13	17811	2980	2958	2958
q14	269	228	232	228
q15	528	481	491	481
q16	524	383	384	383
q17	956	706	692	692
q18	7281	6793	6658	6658
q19	7371	1554	1529	1529
q20	667	317	298	298
q21	3498	2807	2775	2775
q22	352	300	302	300
Total cold run time: 114537 ms
Total hot run time: 38528 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4412	4240	4238	4238
q2	388	262	265	262
q3	2994	2716	2742	2716
q4	1865	1591	1570	1570
q5	5327	5348	5318	5318
q6	209	122	123	122
q7	2235	1858	1884	1858
q8	3208	3383	3335	3335
q9	8583	8548	8630	8548
q10	4063	3862	3957	3862
q11	604	504	477	477
q12	804	620	662	620
q13	16185	3257	3184	3184
q14	317	280	275	275
q15	544	488	490	488
q16	494	446	443	443
q17	1828	1576	1495	1495
q18	8083	7979	7900	7900
q19	1700	1568	1559	1559
q20	2033	1858	1822	1822
q21	8646	4947	4892	4892
q22	552	463	448	448
Total cold run time: 75074 ms
Total hot run time: 55432 ms

@doris-robot
Copy link

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

query1	880	375	354	354
query2	6180	2708	2290	2290
query3	6639	201	201	201
query4	22704	21239	21220	21220
query5	4122	393	397	393
query6	278	182	184	182
query7	4578	290	302	290
query8	232	188	175	175
query9	8689	2311	2295	2295
query10	403	236	261	236
query11	14637	14066	14163	14066
query12	135	92	86	86
query13	1636	353	354	353
query14	9448	7291	7687	7291
query15	258	177	185	177
query16	8164	265	265	265
query17	1918	570	558	558
query18	2099	286	275	275
query19	254	155	152	152
query20	92	87	88	87
query21	201	127	122	122
query22	5035	4883	4861	4861
query23	33631	33501	32948	32948
query24	9411	3006	2958	2958
query25	616	415	420	415
query26	722	158	155	155
query27	2232	414	385	385
query28	5827	2043	2053	2043
query29	841	614	611	611
query30	302	183	179	179
query31	957	754	764	754
query32	94	52	55	52
query33	630	262	242	242
query34	897	481	487	481
query35	789	695	718	695
query36	1070	933	964	933
query37	115	73	68	68
query38	3516	3331	3343	3331
query39	1626	1580	1557	1557
query40	185	128	128	128
query41	44	45	43	43
query42	109	99	95	95
query43	596	564	566	564
query44	1080	747	732	732
query45	296	272	267	267
query46	1101	767	709	709
query47	2041	1956	1949	1949
query48	376	332	303	303
query49	840	388	398	388
query50	812	390	407	390
query51	6949	6845	6773	6773
query52	101	86	91	86
query53	344	296	266	266
query54	272	226	241	226
query55	78	70	72	70
query56	236	228	220	220
query57	1234	1169	1117	1117
query58	218	199	197	197
query59	3366	3287	3020	3020
query60	264	227	223	223
query61	91	87	85	85
query62	564	435	424	424
query63	305	274	272	272
query64	4575	3969	3961	3961
query65	3088	3020	3012	3012
query66	750	316	320	316
query67	15289	15330	14870	14870
query68	5893	523	540	523
query69	508	290	295	290
query70	1240	1198	1136	1136
query71	1423	1262	1275	1262
query72	6647	2641	2436	2436
query73	721	315	313	313
query74	6856	6534	6379	6379
query75	3415	2618	2650	2618
query76	3666	993	986	986
query77	582	264	256	256
query78	11081	10328	10337	10328
query79	4575	521	519	519
query80	1940	457	428	428
query81	523	238	240	238
query82	1592	99	94	94
query83	331	161	161	161
query84	257	87	84	84
query85	1326	264	259	259
query86	483	295	293	293
query87	3494	3329	3274	3274
query88	4780	2304	2290	2290
query89	488	370	365	365
query90	1898	175	171	171
query91	120	92	94	92
query92	57	45	45	45
query93	5621	491	492	491
query94	1100	173	169	169
query95	386	280	291	280
query96	603	262	252	252
query97	3154	2943	2917	2917
query98	226	220	216	216
query99	1199	889	863	863
Total cold run time: 283247 ms
Total hot run time: 184470 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.08	0.04	0.04
query3	0.23	0.05	0.05
query4	1.68	0.07	0.06
query5	0.47	0.48	0.50
query6	1.47	0.72	0.72
query7	0.02	0.02	0.01
query8	0.05	0.04	0.04
query9	0.53	0.48	0.50
query10	0.55	0.55	0.54
query11	0.16	0.12	0.11
query12	0.14	0.13	0.12
query13	0.62	0.58	0.58
query14	0.78	0.77	0.76
query15	0.83	0.81	0.79
query16	0.36	0.36	0.35
query17	0.95	1.02	0.94
query18	0.21	0.26	0.24
query19	1.84	1.79	1.66
query20	0.01	0.02	0.01
query21	15.42	0.65	0.64
query22	4.01	7.85	2.18
query23	18.36	1.42	1.19
query24	2.02	0.22	0.20
query25	0.16	0.08	0.08
query26	0.26	0.16	0.15
query27	0.09	0.08	0.08
query28	13.32	0.99	0.98
query29	12.59	3.24	3.20
query30	0.26	0.07	0.05
query31	2.87	0.37	0.37
query32	3.31	0.47	0.46
query33	2.82	2.78	2.82
query34	17.11	4.37	4.44
query35	4.50	4.51	4.46
query36	0.64	0.46	0.45
query37	0.18	0.15	0.15
query38	0.15	0.14	0.15
query39	0.04	0.03	0.04
query40	0.19	0.15	0.15
query41	0.10	0.05	0.05
query42	0.05	0.05	0.05
query43	0.04	0.04	0.03
Total cold run time: 109.51 s
Total hot run time: 30.25 s

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17605	4244	4238	4238
q2	2013	192	190	190
q3	10430	1190	1246	1190
q4	10189	759	695	695
q5	7528	2694	2609	2609
q6	218	132	134	132
q7	1022	624	602	602
q8	9236	2074	2044	2044
q9	7474	6555	6507	6507
q10	8454	3501	3526	3501
q11	439	232	234	232
q12	555	223	223	223
q13	17759	2939	2967	2939
q14	266	233	239	233
q15	529	477	474	474
q16	520	383	373	373
q17	957	623	718	623
q18	7285	6721	6693	6693
q19	5004	1579	1525	1525
q20	641	325	298	298
q21	3901	2769	2756	2756
q22	366	313	311	311
Total cold run time: 112391 ms
Total hot run time: 38388 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4294	4203	4185	4185
q2	359	280	269	269
q3	2991	2744	2801	2744
q4	1863	1656	1622	1622
q5	5359	5344	5316	5316
q6	208	124	124	124
q7	2252	1850	1886	1850
q8	3202	3324	3290	3290
q9	8591	8532	8546	8532
q10	4051	3922	3882	3882
q11	658	492	501	492
q12	788	633	618	618
q13	16453	3210	3125	3125
q14	309	297	311	297
q15	521	490	475	475
q16	493	453	452	452
q17	1830	1535	1472	1472
q18	8039	7865	8000	7865
q19	1714	1539	1544	1539
q20	2043	1875	1800	1800
q21	5199	4964	4966	4964
q22	561	462	437	437
Total cold run time: 71778 ms
Total hot run time: 55350 ms

@doris-robot
Copy link

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

query1	893	362	357	357
query2	6222	2595	2448	2448
query3	6671	207	204	204
query4	23991	21244	21450	21244
query5	4182	405	404	404
query6	287	187	188	187
query7	4597	284	292	284
query8	243	202	185	185
query9	8585	2360	2326	2326
query10	412	234	255	234
query11	14669	14165	14249	14165
query12	140	87	84	84
query13	1641	359	379	359
query14	9722	8044	7966	7966
query15	257	178	182	178
query16	8261	278	269	269
query17	2029	577	558	558
query18	2132	280	271	271
query19	324	158	157	157
query20	93	86	90	86
query21	204	131	125	125
query22	5084	4826	4913	4826
query23	33783	32909	33323	32909
query24	10832	3080	3076	3076
query25	618	410	415	410
query26	712	159	154	154
query27	2358	370	379	370
query28	5914	2100	2064	2064
query29	903	654	646	646
query30	318	180	175	175
query31	992	763	763	763
query32	93	55	60	55
query33	762	254	262	254
query34	1084	500	505	500
query35	842	714	704	704
query36	1066	917	935	917
query37	116	76	77	76
query38	3473	3387	3361	3361
query39	1625	1606	1765	1606
query40	169	139	131	131
query41	46	43	42	42
query42	106	95	97	95
query43	573	529	557	529
query44	1220	750	744	744
query45	287	273	275	273
query46	1102	737	716	716
query47	2029	1939	1932	1932
query48	373	300	308	300
query49	817	392	408	392
query50	805	411	417	411
query51	6846	6843	6696	6696
query52	102	87	90	87
query53	345	281	280	280
query54	302	230	235	230
query55	83	72	72	72
query56	238	223	224	223
query57	1262	1127	1118	1118
query58	215	192	196	192
query59	3463	3210	3012	3012
query60	253	232	223	223
query61	87	86	84	84
query62	587	432	430	430
query63	313	280	281	280
query64	4672	4025	3878	3878
query65	3051	2991	3019	2991
query66	731	336	320	320
query67	15606	15069	15057	15057
query68	8914	537	563	537
query69	552	305	315	305
query70	1261	1124	1186	1124
query71	1481	1263	1260	1260
query72	6520	2624	2449	2449
query73	1114	317	324	317
query74	6886	6502	6455	6455
query75	4110	2649	2615	2615
query76	5187	985	981	981
query77	602	271	273	271
query78	11014	10233	10204	10204
query79	12268	516	500	500
query80	2375	429	437	429
query81	531	250	243	243
query82	252	92	91	91
query83	204	165	159	159
query84	266	80	81	80
query85	971	258	271	258
query86	341	292	301	292
query87	3479	3282	3324	3282
query88	5551	2312	2325	2312
query89	508	362	372	362
query90	2042	185	174	174
query91	119	98	93	93
query92	64	48	47	47
query93	6949	497	487	487
query94	1303	177	173	173
query95	387	288	294	288
query96	610	266	256	256
query97	3146	2941	2925	2925
query98	236	214	215	214
query99	1191	884	889	884
Total cold run time: 302247 ms
Total hot run time: 185762 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.02
query2	0.08	0.04	0.04
query3	0.23	0.04	0.04
query4	1.67	0.06	0.07
query5	0.49	0.49	0.47
query6	1.49	0.72	0.72
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.54	0.49	0.49
query10	0.54	0.56	0.54
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.59	0.59	0.59
query14	0.74	0.77	0.79
query15	0.83	0.81	0.82
query16	0.36	0.37	0.37
query17	1.02	0.92	1.02
query18	0.20	0.27	0.20
query19	1.78	1.65	1.67
query20	0.01	0.02	0.01
query21	15.42	0.66	0.66
query22	4.29	6.51	1.96
query23	18.30	1.41	1.21
query24	1.59	0.24	0.28
query25	0.14	0.08	0.08
query26	0.26	0.16	0.15
query27	0.08	0.08	0.07
query28	13.37	1.00	0.97
query29	12.54	3.25	3.24
query30	0.27	0.06	0.06
query31	2.87	0.39	0.37
query32	3.27	0.46	0.45
query33	2.87	2.80	2.84
query34	17.09	4.43	4.43
query35	4.50	4.50	4.47
query36	0.65	0.48	0.45
query37	0.17	0.16	0.15
query38	0.15	0.15	0.14
query39	0.05	0.04	0.04
query40	0.18	0.14	0.13
query41	0.09	0.04	0.04
query42	0.06	0.04	0.05
query43	0.04	0.04	0.04
Total cold run time: 109.24 s
Total hot run time: 30.18 s

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17586	4471	4422	4422
q2	1989	178	176	176
q3	10467	1127	1157	1127
q4	10196	769	732	732
q5	7503	2648	2609	2609
q6	222	131	133	131
q7	999	629	590	590
q8	9227	2056	2050	2050
q9	7305	6637	6551	6551
q10	8471	3554	3520	3520
q11	437	236	235	235
q12	530	219	215	215
q13	17825	2924	2940	2924
q14	286	231	220	220
q15	512	479	477	477
q16	524	388	378	378
q17	945	675	639	639
q18	7325	6651	6742	6651
q19	8049	1508	1503	1503
q20	641	304	309	304
q21	3511	2788	2766	2766
q22	376	300	311	300
Total cold run time: 114926 ms
Total hot run time: 38520 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4382	4211	4224	4211
q2	369	281	257	257
q3	2972	2775	2743	2743
q4	1852	1564	1656	1564
q5	5322	5318	5324	5318
q6	208	120	121	120
q7	2230	1873	1876	1873
q8	3207	3341	3320	3320
q9	8599	8590	8562	8562
q10	3879	3679	3700	3679
q11	592	472	475	472
q12	760	590	598	590
q13	17284	2919	2930	2919
q14	296	288	272	272
q15	515	473	466	466
q16	483	432	418	418
q17	1766	1498	1487	1487
q18	8025	7955	7914	7914
q19	1700	1541	1617	1541
q20	2038	1856	1835	1835
q21	8952	5080	4969	4969
q22	555	491	459	459
Total cold run time: 75986 ms
Total hot run time: 54989 ms

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17577	4279	4183	4183
q2	2011	184	183	183
q3	10458	1178	1198	1178
q4	10192	794	715	715
q5	7531	2699	2633	2633
q6	219	132	135	132
q7	990	606	588	588
q8	9212	2048	2027	2027
q9	7280	6575	6503	6503
q10	8567	3531	3513	3513
q11	453	236	222	222
q12	457	219	210	210
q13	17776	2952	2962	2952
q14	259	213	230	213
q15	534	474	461	461
q16	529	378	379	378
q17	956	653	674	653
q18	7356	6726	6684	6684
q19	7344	1557	1531	1531
q20	650	313	305	305
q21	3540	2702	2837	2702
q22	366	301	306	301
Total cold run time: 114257 ms
Total hot run time: 38267 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4381	4186	4230	4186
q2	372	265	264	264
q3	2945	2757	2732	2732
q4	1868	1577	1540	1540
q5	5338	5366	5318	5318
q6	209	122	121	121
q7	2239	1861	1881	1861
q8	3215	3346	3354	3346
q9	8567	8548	8642	8548
q10	4051	3877	4025	3877
q11	593	504	492	492
q12	819	632	641	632
q13	16039	3220	3165	3165
q14	327	269	282	269
q15	507	493	513	493
q16	512	435	439	435
q17	1829	1520	1515	1515
q18	8063	7922	7834	7834
q19	1661	1521	1582	1521
q20	2035	1870	1829	1829
q21	5227	4909	5100	4909
q22	527	468	441	441
Total cold run time: 71324 ms
Total hot run time: 55328 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 185273 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 60a0b3c7107bfe9dd64bab213c19b23953e7f517, data reload: false

query1	892	368	380	368
query2	6190	2726	2404	2404
query3	6651	207	201	201
query4	23093	21327	21447	21327
query5	4110	405	407	405
query6	276	216	175	175
query7	4579	292	280	280
query8	240	202	189	189
query9	8442	2350	2325	2325
query10	419	238	250	238
query11	14664	14288	14151	14151
query12	138	87	85	85
query13	1639	383	344	344
query14	9731	7918	7675	7675
query15	276	184	179	179
query16	8225	257	251	251
query17	2003	568	540	540
query18	2103	265	263	263
query19	338	149	145	145
query20	91	84	83	83
query21	198	126	124	124
query22	5032	4848	4843	4843
query23	34364	33219	33584	33219
query24	10603	3022	3043	3022
query25	600	396	380	380
query26	728	159	152	152
query27	2273	364	370	364
query28	5989	2099	2110	2099
query29	876	617	615	615
query30	271	182	186	182
query31	1011	805	751	751
query32	89	53	54	53
query33	638	251	245	245
query34	923	479	500	479
query35	864	707	720	707
query36	1107	939	918	918
query37	109	69	66	66
query38	3555	3396	3221	3221
query39	1624	1582	1579	1579
query40	180	127	121	121
query41	45	43	41	41
query42	104	101	94	94
query43	596	565	534	534
query44	1099	746	742	742
query45	276	253	280	253
query46	1113	755	753	753
query47	2085	1957	1961	1957
query48	379	309	302	302
query49	832	404	394	394
query50	772	392	383	383
query51	6842	6729	6723	6723
query52	106	84	86	84
query53	339	274	272	272
query54	297	230	233	230
query55	79	72	71	71
query56	241	214	220	214
query57	1208	1111	1119	1111
query58	215	191	194	191
query59	3382	3123	3088	3088
query60	240	230	236	230
query61	107	103	102	102
query62	586	447	453	447
query63	297	280	276	276
query64	4931	4074	3924	3924
query65	3087	2996	3030	2996
query66	755	335	356	335
query67	15413	14797	14979	14797
query68	8457	538	522	522
query69	542	305	308	305
query70	1300	1178	1202	1178
query71	1487	1263	1260	1260
query72	6644	2597	2466	2466
query73	739	314	315	314
query74	6893	6418	6500	6418
query75	3960	2599	2574	2574
query76	5195	1011	947	947
query77	604	265	258	258
query78	10964	10214	10153	10153
query79	7361	514	504	504
query80	1415	426	432	426
query81	506	250	242	242
query82	679	95	94	94
query83	190	165	164	164
query84	260	86	81	81
query85	994	270	318	270
query86	406	288	276	276
query87	3441	3290	3335	3290
query88	4280	2343	2309	2309
query89	462	367	374	367
query90	2018	176	176	176
query91	121	96	92	92
query92	53	46	47	46
query93	5829	502	509	502
query94	956	172	174	172
query95	381	289	311	289
query96	606	263	259	259
query97	3135	2923	2927	2923
query98	229	219	217	217
query99	1214	883	867	867
Total cold run time: 291881 ms
Total hot run time: 185273 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.04
query2	0.08	0.04	0.04
query3	0.23	0.05	0.05
query4	1.67	0.09	0.07
query5	0.49	0.47	0.52
query6	1.48	0.71	0.72
query7	0.02	0.02	0.01
query8	0.05	0.04	0.04
query9	0.54	0.50	0.49
query10	0.55	0.56	0.55
query11	0.15	0.11	0.12
query12	0.14	0.11	0.12
query13	0.59	0.58	0.59
query14	0.75	0.78	0.77
query15	0.82	0.81	0.79
query16	0.37	0.37	0.36
query17	0.93	0.97	0.99
query18	0.23	0.22	0.25
query19	1.78	1.70	1.80
query20	0.02	0.01	0.01
query21	15.48	0.65	0.65
query22	4.24	6.66	2.16
query23	18.31	1.38	1.28
query24	1.28	0.35	0.26
query25	0.13	0.08	0.08
query26	0.25	0.15	0.15
query27	0.08	0.08	0.07
query28	13.41	1.00	0.97
query29	12.60	3.24	3.24
query30	0.25	0.06	0.07
query31	2.85	0.38	0.36
query32	3.30	0.47	0.45
query33	2.84	2.81	2.78
query34	16.97	4.35	4.38
query35	4.47	4.46	4.45
query36	0.65	0.48	0.46
query37	0.20	0.15	0.16
query38	0.15	0.14	0.14
query39	0.05	0.04	0.03
query40	0.17	0.13	0.14
query41	0.10	0.06	0.06
query42	0.05	0.05	0.04
query43	0.04	0.03	0.03
Total cold run time: 108.8 s
Total hot run time: 30.44 s

Copy link
Contributor

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 Apr 22, 2024
Copy link
Contributor

PR approved by anyone and no changes requested.

@morningman morningman merged commit 5c3a650 into apache:master Apr 22, 2024
25 of 28 checks passed
morningman added a commit to morningman/doris that referenced this pull request Apr 27, 2024
…id (apache#33928)

In previously, all statistic tables have a column named `id`.
This column is combined with `tableId` and `indexId`.
Because table's id is unique globally, so we can query statistic table by only `id`
to fetch the table's statistic data.

By for external table, the table's id may not be unique globally. For example, the table id
may only be unique within a database. So we need more predicates to fetch the right statistic data.

In this PR, I changed all query statements of statistic table, by adding `catalog_id` and `database_id` conditions.
For example:

```
SELECT * FROM 
column_statistics
WHERE `id` = '${id}' AND `catalog_id` = '${catalogId}' AND `db_id` = '${dbId}'
```

The content of `id` column in statistic tables remain unchanged, so that after user upgrade Doris,
the existing statistic data can still be used.
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. kind/behavior-changed reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants