Skip to content

Conversation

@LiBinfeng-01
Copy link
Contributor

@LiBinfeng-01 LiBinfeng-01 commented Jun 5, 2024

Add feat of force use/nouse cbo rule hint

  • introduce
    when not using this hint, cbo rules like INFER_SET_OPERATOR_DISTINCT would generate two plans and compare their cost
    and nereids optimizer would decide which is better. But when we want to control the behavior of cbo rules we could use this force cbo rule hint
  • usage example
explain shape plan
select /*+ USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) */
*
from t1
union
select * from t2;

the USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) hint would force rule INFER_SET_OPERATOR_DISTINCT to be used
and generate plan like, which hashAgg below union is generated by this rule:

-- !with_hint_union_distinct --
----hashAgg[GLOBAL]
--------hashAgg[LOCAL]
----------PhysicalUnion
--------------hashAgg[LOCAL]
----------------PhysicalOlapScan[t1]
--------------hashAgg[LOCAL]
----------------PhysicalOlapScan[t2]
Hint log:
Used: INFER_SET_OPERATOR_DISTINCT
UnUsed:
SyntaxError:

When we want to force disable this rule, we could use

explain shape plan select /*+ NO_USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) */ * from t1 union select * from t2;

which would generate plan with this rule:

-- !with_hint_no_union_distinct --
----hashAgg[GLOBAL]
--------hashAgg[LOCAL]
----------PhysicalUnion
--------------PhysicalOlapScan[t1]
--------------PhysicalOlapScan[t2]
Hint log:
Used: NO_INFER_SET_OPERATOR_DISTINCT
UnUsed:
SyntaxError:
  • change sessionvariable enableNereidsRules to varType.remove

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

@LiBinfeng-01
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17617	4312	4276	4276
q2	2028	193	192	192
q3	10475	1215	987	987
q4	10222	820	903	820
q5	7501	2743	2674	2674
q6	215	131	141	131
q7	987	637	605	605
q8	9265	2135	2105	2105
q9	9467	6735	6746	6735
q10	10027	3914	3859	3859
q11	431	242	245	242
q12	456	230	240	230
q13	18159	3111	3334	3111
q14	270	223	228	223
q15	515	476	470	470
q16	476	407	400	400
q17	974	594	648	594
q18	8525	7930	7929	7929
q19	7145	1506	1523	1506
q20	696	343	339	339
q21	5358	4301	4391	4301
q22	431	378	361	361
Total cold run time: 121240 ms
Total hot run time: 42090 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4844	4498	4593	4498
q2	396	268	266	266
q3	3330	3221	2922	2922
q4	1984	1662	1658	1658
q5	5529	5555	5545	5545
q6	221	125	124	124
q7	2154	1842	1854	1842
q8	3223	3412	3374	3374
q9	8543	8686	8713	8686
q10	4080	3746	3667	3667
q11	586	493	485	485
q12	793	644	648	644
q13	15926	3087	3122	3087
q14	281	272	285	272
q15	524	467	489	467
q16	477	428	425	425
q17	1816	1551	1481	1481
q18	8000	7528	7318	7318
q19	1701	1665	1590	1590
q20	3069	1784	1780	1780
q21	11888	4796	4745	4745
q22	633	555	544	544
Total cold run time: 79998 ms
Total hot run time: 55420 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 175056 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 302e0598cf9707fe60a23ee78c06e13d7601f684, data reload: false

query1	971	418	409	409
query2	6475	2552	2301	2301
query3	6671	224	227	224
query4	19131	17469	17340	17340
query5	4151	521	522	521
query6	251	155	154	154
query7	4590	303	314	303
query8	360	317	318	317
query9	8462	2427	2410	2410
query10	444	273	280	273
query11	10549	10055	10115	10055
query12	148	100	112	100
query13	1634	368	357	357
query14	10131	7092	7916	7092
query15	245	207	229	207
query16	7787	267	271	267
query17	1375	540	526	526
query18	1938	298	275	275
query19	200	160	165	160
query20	117	98	95	95
query21	214	144	134	134
query22	4423	4156	3949	3949
query23	33698	33124	33284	33124
query24	11267	2943	2865	2865
query25	803	528	517	517
query26	1528	165	162	162
query27	2981	330	331	330
query28	7590	2111	2035	2035
query29	994	610	589	589
query30	287	155	158	155
query31	971	746	786	746
query32	95	53	56	53
query33	869	352	358	352
query34	915	494	497	494
query35	748	626	607	607
query36	1078	932	946	932
query37	165	82	82	82
query38	2984	2822	2827	2822
query39	874	851	817	817
query40	286	136	131	131
query41	64	67	62	62
query42	133	106	108	106
query43	608	578	570	570
query44	1303	733	745	733
query45	199	166	163	163
query46	1124	737	750	737
query47	1843	1741	1809	1741
query48	400	324	325	324
query49	1090	411	431	411
query50	784	389	396	389
query51	6836	6720	6747	6720
query52	109	95	104	95
query53	375	313	328	313
query54	963	495	493	493
query55	81	84	81	81
query56	351	337	330	330
query57	1137	1049	1059	1049
query58	296	280	279	279
query59	3377	3187	3178	3178
query60	365	350	351	350
query61	178	177	175	175
query62	666	436	433	433
query63	339	311	307	307
query64	10338	2718	2303	2303
query65	3238	3129	3167	3129
query66	1210	317	319	317
query67	15396	14924	15131	14924
query68	6534	572	559	559
query69	599	463	393	393
query70	1196	1078	1098	1078
query71	505	295	302	295
query72	7714	5528	5502	5502
query73	792	343	341	341
query74	5950	5558	5506	5506
query75	4038	2688	2686	2686
query76	4335	908	910	908
query77	705	331	333	331
query78	10556	9852	9763	9763
query79	2042	529	532	529
query80	2242	455	456	455
query81	576	229	225	225
query82	1391	114	112	112
query83	313	200	203	200
query84	274	83	86	83
query85	1455	261	260	260
query86	484	312	306	306
query87	3267	3150	3090	3090
query88	3430	2353	2380	2353
query89	495	393	389	389
query90	1860	188	193	188
query91	182	150	149	149
query92	65	48	47	47
query93	2180	520	501	501
query94	1258	188	191	188
query95	398	312	309	309
query96	602	267	272	267
query97	3198	3051	3008	3008
query98	254	225	241	225
query99	1319	816	847	816
Total cold run time: 281412 ms
Total hot run time: 175056 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.04
query2	0.08	0.04	0.04
query3	0.22	0.05	0.05
query4	1.68	0.07	0.07
query5	0.51	0.48	0.50
query6	1.13	0.72	0.72
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.55	0.49	0.49
query10	0.55	0.54	0.53
query11	0.15	0.11	0.12
query12	0.16	0.11	0.11
query13	0.59	0.59	0.59
query14	0.79	0.77	0.79
query15	0.82	0.82	0.80
query16	0.35	0.36	0.37
query17	1.02	0.95	1.05
query18	0.22	0.25	0.23
query19	1.81	1.72	1.71
query20	0.02	0.01	0.01
query21	15.43	0.70	0.68
query22	4.52	6.75	2.03
query23	18.30	1.35	1.29
query24	1.60	0.30	0.22
query25	0.15	0.09	0.09
query26	0.27	0.17	0.17
query27	0.07	0.08	0.08
query28	13.31	1.02	1.01
query29	13.34	3.28	3.27
query30	0.24	0.06	0.05
query31	2.88	0.40	0.39
query32	3.26	0.48	0.46
query33	2.87	2.94	2.88
query34	17.24	4.40	4.38
query35	4.47	4.50	4.65
query36	0.66	0.46	0.46
query37	0.17	0.14	0.15
query38	0.15	0.14	0.14
query39	0.04	0.04	0.03
query40	0.16	0.14	0.15
query41	0.10	0.05	0.05
query42	0.05	0.04	0.05
query43	0.05	0.04	0.03
Total cold run time: 110.09 s
Total hot run time: 30.65 s

@LiBinfeng-01
Copy link
Contributor Author

run buildall

@LiBinfeng-01 LiBinfeng-01 force-pushed the feat_cost_based_rule branch from 02b9444 to b6f4ede Compare June 6, 2024 08:03
@LiBinfeng-01
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17602	4284	4226	4226
q2	2024	192	186	186
q3	10459	1213	1160	1160
q4	10194	771	791	771
q5	7509	2721	2747	2721
q6	226	137	139	137
q7	965	620	607	607
q8	9211	2138	2086	2086
q9	9436	6698	6719	6698
q10	9749	3892	3835	3835
q11	435	245	234	234
q12	489	231	252	231
q13	17557	3224	3302	3224
q14	251	217	215	215
q15	518	471	472	471
q16	503	392	404	392
q17	976	661	693	661
q18	8381	7926	7814	7814
q19	7563	1333	1367	1333
q20	656	340	313	313
q21	5200	4053	3420	3420
q22	395	341	339	339
Total cold run time: 120299 ms
Total hot run time: 41074 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4641	4459	4458	4458
q2	386	268	268	268
q3	3124	2951	2897	2897
q4	1887	1571	1575	1571
q5	5501	5476	5538	5476
q6	217	124	130	124
q7	2190	1797	1802	1797
q8	3230	3396	3392	3392
q9	8675	8650	8706	8650
q10	4038	3865	3703	3703
q11	595	482	494	482
q12	785	579	609	579
q13	17217	3109	3131	3109
q14	312	261	267	261
q15	514	503	490	490
q16	484	417	414	414
q17	1836	1493	1472	1472
q18	7937	7492	7311	7311
q19	1690	1582	1469	1469
q20	2079	1810	1819	1810
q21	9935	4738	4790	4738
q22	640	535	520	520
Total cold run time: 77913 ms
Total hot run time: 54991 ms

@doris-robot
Copy link

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

query1	984	404	388	388
query2	6453	2458	2344	2344
query3	6666	231	231	231
query4	19450	17126	17181	17126
query5	4181	510	520	510
query6	242	149	152	149
query7	4597	297	302	297
query8	346	312	333	312
query9	8579	2388	2381	2381
query10	429	274	270	270
query11	10611	10059	10096	10059
query12	153	93	93	93
query13	1642	352	363	352
query14	10246	7181	7726	7181
query15	240	203	206	203
query16	7797	264	258	258
query17	1705	509	526	509
query18	1951	275	268	268
query19	193	161	154	154
query20	103	92	93	92
query21	209	133	129	129
query22	4322	4004	3913	3913
query23	33706	33127	33084	33084
query24	10983	2902	2790	2790
query25	721	447	441	441
query26	1186	150	156	150
query27	2961	316	308	308
query28	7219	2041	2058	2041
query29	870	604	598	598
query30	292	154	155	154
query31	987	728	765	728
query32	92	52	53	52
query33	844	351	347	347
query34	918	496	497	496
query35	747	634	633	633
query36	1086	904	932	904
query37	191	81	82	81
query38	2894	2738	2737	2737
query39	843	787	818	787
query40	212	118	120	118
query41	63	70	63	63
query42	123	107	102	102
query43	585	556	560	556
query44	1167	709	723	709
query45	195	165	166	165
query46	1106	736	725	725
query47	1887	1793	1792	1792
query48	387	316	312	312
query49	1073	390	408	390
query50	770	389	379	379
query51	6864	6726	6672	6672
query52	112	103	103	103
query53	366	298	303	298
query54	901	521	502	502
query55	81	83	82	82
query56	354	322	325	322
query57	1114	1076	1071	1071
query58	299	278	280	278
query59	3440	3313	3132	3132
query60	371	346	395	346
query61	219	228	220	220
query62	684	459	457	457
query63	340	316	305	305
query64	9710	2954	2472	2472
query65	3230	3115	3131	3115
query66	1098	338	349	338
query67	15447	14781	14774	14774
query68	5925	582	655	582
query69	677	418	392	392
query70	1207	1146	1131	1131
query71	490	286	282	282
query72	8767	5534	5648	5534
query73	777	331	333	331
query74	6046	5498	5554	5498
query75	4566	2648	2675	2648
query76	3513	939	831	831
query77	748	331	329	329
query78	10272	9854	9729	9729
query79	8536	531	528	528
query80	996	472	465	465
query81	556	225	223	223
query82	763	116	113	113
query83	379	199	233	199
query84	278	83	87	83
query85	1394	265	259	259
query86	418	300	287	287
query87	3314	3087	3084	3084
query88	4864	2376	2365	2365
query89	551	402	403	402
query90	1874	189	192	189
query91	180	146	150	146
query92	62	48	49	48
query93	6438	510	503	503
query94	1199	188	184	184
query95	388	312	308	308
query96	616	267	262	262
query97	3217	3044	3015	3015
query98	219	216	204	204
query99	1217	838	831	831
Total cold run time: 290284 ms
Total hot run time: 174333 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 31.5 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit b6f4edec05426be813e0d7d65932177067f92284, 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.70	0.07	0.07
query5	0.50	0.50	0.49
query6	1.12	0.73	0.73
query7	0.01	0.01	0.02
query8	0.05	0.04	0.04
query9	0.54	0.49	0.49
query10	0.54	0.55	0.54
query11	0.15	0.11	0.11
query12	0.14	0.12	0.12
query13	0.60	0.59	0.60
query14	0.77	0.78	0.77
query15	0.84	0.80	0.81
query16	0.34	0.36	0.37
query17	0.97	0.97	0.94
query18	0.20	0.27	0.22
query19	1.78	1.71	1.72
query20	0.02	0.01	0.01
query21	15.72	0.67	0.67
query22	3.91	6.14	2.93
query23	18.34	1.42	1.30
query24	2.09	0.22	0.22
query25	0.14	0.08	0.09
query26	0.27	0.18	0.17
query27	0.09	0.07	0.08
query28	13.20	1.02	0.99
query29	13.10	3.34	3.24
query30	0.24	0.06	0.05
query31	2.90	0.38	0.39
query32	3.26	0.48	0.46
query33	2.87	2.92	2.89
query34	17.23	4.40	4.38
query35	4.46	4.49	4.50
query36	0.69	0.51	0.48
query37	0.17	0.14	0.15
query38	0.15	0.14	0.14
query39	0.04	0.03	0.03
query40	0.16	0.15	0.15
query41	0.09	0.04	0.04
query42	0.06	0.05	0.05
query43	0.04	0.04	0.03
Total cold run time: 109.84 s
Total hot run time: 31.5 s

@LiBinfeng-01 LiBinfeng-01 force-pushed the feat_cost_based_rule branch from b6f4ede to c2f1a44 Compare June 7, 2024 03:00
@LiBinfeng-01
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17620	4383	4246	4246
q2	2015	192	195	192
q3	10459	1216	1211	1211
q4	10190	802	741	741
q5	7487	2834	2682	2682
q6	220	132	134	132
q7	976	611	625	611
q8	9232	2148	2088	2088
q9	9585	6732	6778	6732
q10	9390	3876	3875	3875
q11	455	247	244	244
q12	505	229	229	229
q13	17229	3221	3187	3187
q14	279	238	238	238
q15	531	491	469	469
q16	492	386	372	372
q17	976	767	650	650
q18	8461	7927	7828	7828
q19	6804	1259	1456	1259
q20	635	327	331	327
q21	5248	4006	4159	4006
q22	398	348	348	348
Total cold run time: 119187 ms
Total hot run time: 41667 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4626	4365	4388	4365
q2	373	263	265	263
q3	3158	2840	2945	2840
q4	1883	1567	1600	1567
q5	5438	5534	5507	5507
q6	222	124	122	122
q7	2169	1843	1820	1820
q8	3255	3384	3372	3372
q9	8705	8645	8694	8645
q10	4078	3825	3878	3825
q11	584	506	466	466
q12	783	602	608	602
q13	15804	3103	3172	3103
q14	311	274	268	268
q15	537	479	481	479
q16	474	437	439	437
q17	1794	1497	1514	1497
q18	8145	7714	7522	7522
q19	2563	1576	1613	1576
q20	3031	1779	1799	1779
q21	4925	4853	4797	4797
q22	675	547	544	544
Total cold run time: 73533 ms
Total hot run time: 55396 ms

@doris-robot
Copy link

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

query1	985	404	397	397
query2	6454	2440	2388	2388
query3	6677	226	246	226
query4	19753	17234	17114	17114
query5	4237	500	519	500
query6	242	153	169	153
query7	4599	296	301	296
query8	364	327	343	327
query9	8524	2413	2367	2367
query10	451	288	270	270
query11	10518	10015	10015	10015
query12	145	94	93	93
query13	1618	362	361	361
query14	10341	7530	7247	7247
query15	248	201	215	201
query16	7419	263	256	256
query17	1366	510	509	509
query18	1310	278	271	271
query19	190	152	154	152
query20	98	91	99	91
query21	207	131	136	131
query22	4415	4004	4094	4004
query23	33533	33151	33212	33151
query24	11132	2868	2795	2795
query25	728	442	451	442
query26	1027	152	153	152
query27	2842	314	318	314
query28	6903	2041	2039	2039
query29	880	602	609	602
query30	298	153	157	153
query31	984	764	765	764
query32	90	54	54	54
query33	854	361	357	357
query34	897	481	486	481
query35	737	606	610	606
query36	1045	936	913	913
query37	165	78	81	78
query38	2918	2770	2729	2729
query39	880	791	769	769
query40	229	122	121	121
query41	66	61	63	61
query42	127	104	103	103
query43	587	526	520	520
query44	1211	729	739	729
query45	191	170	163	163
query46	1112	724	745	724
query47	1895	1764	1776	1764
query48	390	332	327	327
query49	1083	395	399	395
query50	780	380	388	380
query51	6716	6668	6577	6577
query52	109	99	98	98
query53	374	300	307	300
query54	927	496	497	496
query55	84	80	87	80
query56	364	362	333	333
query57	1139	1084	1078	1078
query58	287	283	281	281
query59	3596	3144	3224	3144
query60	378	347	357	347
query61	170	173	171	171
query62	639	441	448	441
query63	335	316	304	304
query64	9492	2632	2348	2348
query65	3168	3088	3121	3088
query66	892	331	315	315
query67	15652	14882	14890	14882
query68	4463	562	551	551
query69	456	309	298	298
query70	1137	1185	1069	1069
query71	382	282	290	282
query72	6891	4424	2643	2643
query73	750	332	333	332
query74	5990	5502	5534	5502
query75	3315	2662	2641	2641
query76	2520	896	870	870
query77	487	342	320	320
query78	10449	9994	9700	9700
query79	2433	521	531	521
query80	1135	454	453	453
query81	554	223	228	223
query82	753	114	112	112
query83	271	201	199	199
query84	244	82	86	82
query85	1790	321	255	255
query86	508	318	321	318
query87	3258	3059	3104	3059
query88	4231	2305	2316	2305
query89	483	394	386	386
query90	1808	184	185	184
query91	184	150	149	149
query92	64	46	47	46
query93	2494	525	509	509
query94	1226	181	181	181
query95	401	299	306	299
query96	588	261	266	261
query97	3170	3011	3044	3011
query98	215	212	212	212
query99	1343	842	829	829
Total cold run time: 272060 ms
Total hot run time: 171140 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 c2f1a44ac8ea67d64a64ad4c4cba6967a886be16, data reload: false

query1	0.04	0.03	0.04
query2	0.08	0.04	0.04
query3	0.23	0.06	0.05
query4	1.65	0.07	0.08
query5	0.51	0.49	0.51
query6	1.12	0.72	0.73
query7	0.02	0.02	0.01
query8	0.06	0.04	0.04
query9	0.54	0.50	0.49
query10	0.54	0.55	0.55
query11	0.15	0.11	0.11
query12	0.15	0.13	0.12
query13	0.60	0.58	0.60
query14	0.79	0.78	0.77
query15	0.84	0.81	0.82
query16	0.37	0.36	0.37
query17	1.04	1.04	1.03
query18	0.20	0.25	0.24
query19	1.92	1.83	1.73
query20	0.02	0.01	0.01
query21	15.51	0.70	0.68
query22	4.72	6.68	2.04
query23	18.32	1.40	1.31
query24	2.08	0.22	0.22
query25	0.15	0.09	0.09
query26	0.27	0.17	0.17
query27	0.07	0.07	0.08
query28	13.26	1.01	0.99
query29	13.36	3.32	3.29
query30	0.25	0.06	0.05
query31	2.87	0.40	0.38
query32	3.26	0.46	0.48
query33	2.88	2.88	2.92
query34	17.19	4.47	4.39
query35	4.48	4.49	4.65
query36	0.65	0.47	0.46
query37	0.17	0.15	0.16
query38	0.14	0.14	0.14
query39	0.04	0.04	0.04
query40	0.17	0.14	0.15
query41	0.08	0.04	0.05
query42	0.05	0.04	0.05
query43	0.04	0.03	0.03
Total cold run time: 110.88 s
Total hot run time: 30.8 s

@LiBinfeng-01 LiBinfeng-01 force-pushed the feat_cost_based_rule branch from c2f1a44 to e826419 Compare June 7, 2024 07:01
@LiBinfeng-01
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17899	4564	4476	4476
q2	2450	191	208	191
q3	11867	1145	1177	1145
q4	10617	844	756	756
q5	7533	2700	2625	2625
q6	225	136	139	136
q7	964	632	615	615
q8	9297	2064	2078	2064
q9	8762	6479	6472	6472
q10	8956	3711	3737	3711
q11	475	241	239	239
q12	398	227	218	218
q13	17769	2949	2964	2949
q14	263	232	208	208
q15	517	468	480	468
q16	513	370	380	370
q17	964	632	729	632
q18	8091	7446	7431	7431
q19	5084	1421	1546	1421
q20	657	309	305	305
q21	5060	3233	3349	3233
q22	383	333	326	326
Total cold run time: 118744 ms
Total hot run time: 39991 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4410	4244	4290	4244
q2	360	261	261	261
q3	3025	2760	2679	2679
q4	1818	1595	1540	1540
q5	5263	5271	5243	5243
q6	217	125	126	125
q7	2121	1672	1725	1672
q8	3133	3595	3306	3306
q9	8271	8355	8345	8345
q10	3872	3621	3633	3621
q11	578	537	471	471
q12	758	595	566	566
q13	16338	2965	2961	2961
q14	277	280	275	275
q15	521	462	480	462
q16	475	413	417	413
q17	1782	1470	1474	1470
q18	7664	7454	7486	7454
q19	1642	1564	1591	1564
q20	1959	1801	1757	1757
q21	4789	4674	4730	4674
q22	645	541	511	511
Total cold run time: 69918 ms
Total hot run time: 53614 ms

@doris-robot
Copy link

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

query1	1006	400	391	391
query2	6461	2349	2403	2349
query3	6741	240	242	240
query4	19871	17292	17116	17116
query5	4168	506	521	506
query6	246	160	157	157
query7	4599	309	316	309
query8	360	307	324	307
query9	8529	2381	2380	2380
query10	436	282	266	266
query11	10446	10109	9960	9960
query12	149	93	91	91
query13	1635	367	362	362
query14	10315	6971	7763	6971
query15	247	200	201	200
query16	7261	253	250	250
query17	1872	518	524	518
query18	1814	274	266	266
query19	192	154	152	152
query20	101	117	93	93
query21	209	132	122	122
query22	4325	4081	4100	4081
query23	33739	33000	32934	32934
query24	12002	2822	2780	2780
query25	777	478	451	451
query26	1791	153	151	151
query27	2938	307	319	307
query28	7134	2035	2018	2018
query29	1007	601	602	601
query30	292	152	157	152
query31	973	748	726	726
query32	93	57	52	52
query33	844	352	411	352
query34	909	485	490	485
query35	752	593	586	586
query36	1115	922	933	922
query37	250	87	82	82
query38	2899	2731	2725	2725
query39	871	807	783	783
query40	284	128	123	123
query41	67	63	61	61
query42	122	104	102	102
query43	604	542	566	542
query44	1188	721	739	721
query45	190	162	166	162
query46	1119	745	715	715
query47	1851	1776	1764	1764
query48	401	318	323	318
query49	1194	397	411	397
query50	785	391	385	385
query51	6717	6718	6652	6652
query52	119	96	102	96
query53	373	313	307	307
query54	1057	505	521	505
query55	85	84	84	84
query56	421	392	384	384
query57	1138	1114	1063	1063
query58	290	290	271	271
query59	3494	3349	3236	3236
query60	383	343	353	343
query61	173	174	176	174
query62	641	447	440	440
query63	335	310	308	308
query64	10595	2707	2295	2295
query65	3209	3101	3140	3101
query66	1399	335	339	335
query67	15452	15010	14923	14923
query68	5896	566	567	566
query69	619	444	378	378
query70	1178	1087	1137	1087
query71	488	286	281	281
query72	7090	2736	2643	2643
query73	791	335	335	335
query74	5902	5515	5568	5515
query75	3832	2662	2686	2662
query76	3591	931	876	876
query77	659	327	322	322
query78	10265	9868	9784	9784
query79	2180	553	543	543
query80	1791	470	462	462
query81	565	222	233	222
query82	968	120	118	118
query83	313	206	205	205
query84	257	91	94	91
query85	1379	310	267	267
query86	468	339	324	324
query87	3225	3079	3114	3079
query88	3781	2327	2318	2318
query89	500	411	414	411
query90	1833	191	193	191
query91	183	151	156	151
query92	63	48	48	48
query93	1810	529	510	510
query94	1156	192	190	190
query95	399	315	315	315
query96	593	270	267	267
query97	3249	2988	3014	2988
query98	224	215	212	212
query99	1268	835	833	833
Total cold run time: 279571 ms
Total hot run time: 171195 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.08	0.04	0.04
query3	0.24	0.05	0.04
query4	1.67	0.07	0.08
query5	0.51	0.48	0.51
query6	1.13	0.72	0.72
query7	0.02	0.02	0.02
query8	0.06	0.04	0.04
query9	0.54	0.48	0.49
query10	0.55	0.55	0.54
query11	0.17	0.12	0.11
query12	0.15	0.12	0.12
query13	0.59	0.60	0.61
query14	0.79	0.78	0.80
query15	0.84	0.83	0.80
query16	0.36	0.36	0.37
query17	0.96	0.98	0.96
query18	0.20	0.27	0.23
query19	1.91	1.82	1.72
query20	0.02	0.01	0.01
query21	15.45	0.71	0.67
query22	3.74	6.83	2.46
query23	18.29	1.45	1.40
query24	2.14	0.22	0.21
query25	0.16	0.08	0.09
query26	0.28	0.18	0.17
query27	0.09	0.08	0.08
query28	13.25	1.02	0.99
query29	12.64	3.18	3.20
query30	0.26	0.05	0.05
query31	2.85	0.41	0.38
query32	3.26	0.47	0.46
query33	2.88	2.91	2.87
query34	17.26	4.42	4.46
query35	4.49	4.43	4.45
query36	0.65	0.47	0.47
query37	0.18	0.15	0.15
query38	0.15	0.15	0.14
query39	0.04	0.03	0.03
query40	0.17	0.14	0.15
query41	0.09	0.05	0.05
query42	0.06	0.05	0.05
query43	0.04	0.04	0.04
Total cold run time: 109.25 s
Total hot run time: 31.07 s

@LiBinfeng-01
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17644	4307	4251	4251
q2	2050	193	195	193
q3	10452	1253	1065	1065
q4	10199	811	839	811
q5	7483	2707	2721	2707
q6	215	134	138	134
q7	973	630	611	611
q8	9227	2137	2086	2086
q9	9342	6674	6692	6674
q10	10120	3804	3875	3804
q11	430	238	244	238
q12	453	238	219	219
q13	17549	3226	3105	3105
q14	266	213	221	213
q15	521	472	478	472
q16	505	405	404	404
q17	970	626	702	626
q18	8734	8141	7880	7880
q19	8179	1494	1543	1494
q20	662	329	325	325
q21	5162	3290	4101	3290
q22	396	340	357	340
Total cold run time: 121532 ms
Total hot run time: 40942 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4640	4436	4418	4418
q2	379	265	253	253
q3	3212	2843	2687	2687
q4	1880	1608	1688	1608
q5	5450	5514	5477	5477
q6	223	125	126	125
q7	2183	1815	1831	1815
q8	3285	3382	3370	3370
q9	8632	8698	8732	8698
q10	4028	3745	3672	3672
q11	620	489	518	489
q12	792	625	626	625
q13	17327	3158	3156	3156
q14	319	282	280	280
q15	531	477	479	477
q16	516	447	441	441
q17	1846	1527	1511	1511
q18	7776	7387	7483	7387
q19	1706	1465	1559	1465
q20	2073	1799	1786	1786
q21	10465	4884	4867	4867
q22	699	552	523	523
Total cold run time: 78582 ms
Total hot run time: 55130 ms

@doris-robot
Copy link

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

query1	980	410	398	398
query2	6455	2245	2293	2245
query3	6672	234	229	229
query4	19358	17380	17170	17170
query5	4170	490	492	490
query6	245	156	166	156
query7	4592	300	312	300
query8	345	308	304	304
query9	8759	2399	2373	2373
query10	451	284	283	283
query11	10600	10045	10076	10045
query12	151	99	96	96
query13	1635	372	372	372
query14	10533	6932	6979	6932
query15	236	194	205	194
query16	7386	255	262	255
query17	1373	512	537	512
query18	1940	272	256	256
query19	197	153	153	153
query20	96	91	92	91
query21	204	129	132	129
query22	4424	4068	3946	3946
query23	33581	33197	33048	33048
query24	11150	2853	2840	2840
query25	669	445	453	445
query26	708	155	156	155
query27	2276	313	320	313
query28	5963	2034	2005	2005
query29	857	613	616	613
query30	288	156	158	156
query31	971	749	747	747
query32	94	51	52	51
query33	748	353	351	351
query34	900	480	483	480
query35	767	608	598	598
query36	1066	951	952	951
query37	148	83	79	79
query38	2903	2756	2719	2719
query39	879	791	794	791
query40	210	119	122	119
query41	65	64	61	61
query42	121	104	104	104
query43	549	548	537	537
query44	1059	715	727	715
query45	197	157	156	156
query46	1108	747	748	747
query47	1897	1763	1801	1763
query48	388	328	327	327
query49	1019	392	402	392
query50	789	388	378	378
query51	6809	6640	6678	6640
query52	118	94	99	94
query53	364	308	305	305
query54	949	494	487	487
query55	85	81	80	80
query56	352	323	322	322
query57	1157	1080	1096	1080
query58	308	287	284	284
query59	3392	3079	3216	3079
query60	361	339	336	336
query61	170	168	169	168
query62	638	441	426	426
query63	328	316	302	302
query64	9268	2967	2207	2207
query65	3172	3075	3141	3075
query66	879	329	327	327
query67	15388	14964	14729	14729
query68	6356	553	556	553
query69	601	462	390	390
query70	1230	1144	1136	1136
query71	459	291	274	274
query72	8004	5398	5245	5245
query73	810	331	326	326
query74	5872	5492	5453	5453
query75	3905	2602	2680	2602
query76	3998	914	895	895
query77	681	332	325	325
query78	10502	9735	9739	9735
query79	2945	534	519	519
query80	1488	466	444	444
query81	575	220	224	220
query82	773	115	113	113
query83	238	203	199	199
query84	273	84	80	80
query85	1242	269	254	254
query86	463	296	285	285
query87	3255	3121	3067	3067
query88	4275	2323	2306	2306
query89	498	405	388	388
query90	1806	189	189	189
query91	177	148	145	145
query92	64	48	51	48
query93	4081	539	504	504
query94	1119	188	190	188
query95	397	302	298	298
query96	588	265	261	261
query97	3180	3033	3021	3021
query98	228	207	206	206
query99	1340	844	843	843
Total cold run time: 277333 ms
Total hot run time: 173023 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.09	0.04	0.04
query3	0.23	0.06	0.06
query4	1.66	0.08	0.08
query5	0.52	0.49	0.47
query6	1.13	0.73	0.73
query7	0.02	0.01	0.02
query8	0.05	0.04	0.04
query9	0.54	0.49	0.49
query10	0.53	0.54	0.54
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.79	0.78
query15	0.83	0.80	0.81
query16	0.38	0.38	0.38
query17	1.00	1.05	1.07
query18	0.21	0.27	0.24
query19	1.82	1.74	1.76
query20	0.02	0.01	0.00
query21	15.86	0.69	0.67
query22	4.63	6.90	2.11
query23	18.23	1.39	1.30
query24	2.12	0.26	0.20
query25	0.16	0.09	0.08
query26	0.27	0.17	0.17
query27	0.08	0.09	0.08
query28	13.18	1.02	1.00
query29	13.28	3.28	3.28
query30	0.24	0.05	0.06
query31	2.88	0.41	0.40
query32	3.23	0.47	0.47
query33	2.95	2.94	2.98
query34	17.37	4.47	4.38
query35	4.52	4.56	4.68
query36	0.65	0.46	0.48
query37	0.17	0.15	0.16
query38	0.15	0.15	0.14
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.05	0.04
query43	0.04	0.04	0.04
Total cold run time: 111.11 s
Total hot run time: 31.03 s


private static final Logger LOG = LogManager.getLogger(CostBasedRewriteJob.class);

private static final ImmutableList<Pair<RuleType, String>> RuleHintName =
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this name mapping

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@LiBinfeng-01 LiBinfeng-01 force-pushed the feat_cost_based_rule branch from e826419 to a89e21f Compare June 11, 2024 07:29
@LiBinfeng-01 LiBinfeng-01 changed the title [Feat](Nereids) support cost based rule hint [Feat](Nereids) support force cbo rule hint Jun 11, 2024
@LiBinfeng-01
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17938	4547	4362	4362
q2	2577	192	190	190
q3	12374	1108	1068	1068
q4	10354	784	834	784
q5	7760	2743	2664	2664
q6	223	134	140	134
q7	958	602	602	602
q8	9222	2095	2109	2095
q9	8819	6474	6448	6448
q10	8964	3719	3720	3719
q11	463	245	246	245
q12	489	242	232	232
q13	17752	2989	3022	2989
q14	265	216	208	208
q15	516	475	478	475
q16	512	382	370	370
q17	962	654	715	654
q18	8083	7467	7386	7386
q19	3936	1518	1487	1487
q20	645	330	320	320
q21	4955	3031	3963	3031
q22	397	332	346	332
Total cold run time: 118164 ms
Total hot run time: 39795 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4344	4223	4224	4223
q2	377	273	271	271
q3	2948	2751	2747	2747
q4	1889	1540	1572	1540
q5	5272	5273	5303	5273
q6	213	128	127	127
q7	2055	1704	1666	1666
q8	3185	3313	3298	3298
q9	8345	8376	8338	8338
q10	3905	3696	3605	3605
q11	601	467	493	467
q12	780	610	609	609
q13	17233	2987	2951	2951
q14	312	266	267	266
q15	512	476	485	476
q16	483	417	415	415
q17	1770	1472	1490	1472
q18	7535	7659	7325	7325
q19	1706	1569	1504	1504
q20	1958	1790	1757	1757
q21	4891	4765	4653	4653
q22	646	555	538	538
Total cold run time: 70960 ms
Total hot run time: 53521 ms

@doris-robot
Copy link

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

query1	958	405	367	367
query2	7513	2303	2234	2234
query3	6641	218	218	218
query4	21056	17259	17244	17244
query5	4172	479	450	450
query6	262	156	163	156
query7	4596	299	291	291
query8	324	304	297	297
query9	8607	2450	2424	2424
query10	586	293	267	267
query11	10493	10038	10025	10025
query12	128	83	79	79
query13	1629	365	372	365
query14	9685	6707	7628	6707
query15	241	183	193	183
query16	7861	275	275	275
query17	1875	544	531	531
query18	1995	278	278	278
query19	208	161	159	159
query20	86	86	81	81
query21	204	133	130	130
query22	4314	3998	4110	3998
query23	33696	33157	33179	33157
query24	11017	2787	2911	2787
query25	648	379	391	379
query26	1393	153	158	153
query27	2988	316	319	316
query28	7502	2091	2079	2079
query29	947	640	636	636
query30	284	155	148	148
query31	974	728	750	728
query32	94	54	56	54
query33	784	294	291	291
query34	927	461	479	461
query35	781	623	632	623
query36	1109	948	964	948
query37	164	71	81	71
query38	2882	2739	2719	2719
query39	859	779	794	779
query40	208	125	127	125
query41	56	55	52	52
query42	126	100	101	100
query43	586	563	537	537
query44	1226	719	736	719
query45	207	161	161	161
query46	1076	735	720	720
query47	1852	1801	1804	1801
query48	372	299	302	299
query49	1103	409	417	409
query50	768	385	398	385
query51	6884	6804	6792	6792
query52	106	91	97	91
query53	364	287	296	287
query54	905	460	447	447
query55	75	72	76	72
query56	300	284	285	284
query57	1163	1058	1034	1034
query58	268	274	244	244
query59	3318	3012	3251	3012
query60	316	285	288	285
query61	112	112	106	106
query62	656	456	485	456
query63	329	410	286	286
query64	8944	2200	1776	1776
query65	3175	3079	3081	3079
query66	1326	361	331	331
query67	15726	14846	15014	14846
query68	8842	546	534	534
query69	753	521	419	419
query70	1154	1126	1199	1126
query71	542	269	268	268
query72	8702	5713	5437	5437
query73	1858	326	329	326
query74	5998	5539	5515	5515
query75	5212	2635	2672	2635
query76	5056	930	967	930
query77	762	307	290	290
query78	10718	9869	9664	9664
query79	7994	524	511	511
query80	1009	489	484	484
query81	555	217	221	217
query82	317	103	96	96
query83	359	169	163	163
query84	272	86	85	85
query85	988	282	269	269
query86	355	320	301	301
query87	3268	3048	3066	3048
query88	4600	2470	2466	2466
query89	516	379	404	379
query90	2047	189	190	189
query91	128	99	99	99
query92	63	48	48	48
query93	5924	513	505	505
query94	1337	188	188	188
query95	406	312	318	312
query96	603	273	269	269
query97	3236	3050	3021	3021
query98	206	202	192	192
query99	1155	849	840	840
Total cold run time: 296965 ms
Total hot run time: 172650 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.02
query2	0.07	0.04	0.03
query3	0.22	0.05	0.04
query4	1.68	0.08	0.06
query5	0.48	0.48	0.49
query6	1.13	0.72	0.73
query7	0.02	0.02	0.01
query8	0.05	0.04	0.04
query9	0.54	0.49	0.50
query10	0.52	0.53	0.54
query11	0.14	0.11	0.12
query12	0.15	0.12	0.12
query13	0.60	0.60	0.61
query14	0.77	0.80	0.79
query15	0.83	0.81	0.81
query16	0.36	0.37	0.35
query17	1.00	1.03	1.03
query18	0.21	0.25	0.23
query19	1.86	1.70	1.79
query20	0.01	0.01	0.01
query21	15.45	0.65	0.63
query22	4.41	7.25	2.39
query23	18.30	1.40	1.23
query24	2.08	0.22	0.22
query25	0.14	0.08	0.09
query26	0.28	0.18	0.17
query27	0.08	0.08	0.08
query28	13.29	1.02	1.01
query29	12.59	3.28	3.26
query30	0.26	0.07	0.05
query31	2.85	0.39	0.39
query32	3.29	0.47	0.48
query33	2.89	2.96	2.94
query34	17.14	4.39	4.46
query35	4.51	4.58	4.55
query36	0.64	0.46	0.45
query37	0.19	0.17	0.16
query38	0.16	0.15	0.15
query39	0.05	0.04	0.04
query40	0.18	0.17	0.14
query41	0.09	0.05	0.05
query42	0.06	0.04	0.05
query43	0.05	0.04	0.05
Total cold run time: 109.66 s
Total hot run time: 31.1 s

@LiBinfeng-01
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17825	4603	4420	4420
q2	2478	197	197	197
q3	12357	1188	1110	1110
q4	10541	753	828	753
q5	7524	2668	2632	2632
q6	222	138	140	138
q7	975	604	614	604
q8	9494	2066	2046	2046
q9	8748	6505	6472	6472
q10	8895	3681	3687	3681
q11	465	239	228	228
q12	398	243	225	225
q13	17776	2922	2982	2922
q14	262	230	231	230
q15	530	474	487	474
q16	515	372	380	372
q17	957	687	750	687
q18	8142	7462	7302	7302
q19	6044	1543	1539	1539
q20	676	322	329	322
q21	4861	3174	3254	3174
q22	382	323	334	323
Total cold run time: 120067 ms
Total hot run time: 39851 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4359	4190	4231	4190
q2	366	272	264	264
q3	2964	2772	2700	2700
q4	1849	1599	1635	1599
q5	5226	5266	5254	5254
q6	217	127	125	125
q7	2133	1713	1758	1713
q8	3185	3314	3313	3313
q9	8328	8274	8364	8274
q10	3871	3624	3670	3624
q11	572	489	485	485
q12	814	641	618	618
q13	16407	2987	2975	2975
q14	286	272	251	251
q15	514	490	476	476
q16	474	407	416	407
q17	1763	1474	1457	1457
q18	7533	7525	7420	7420
q19	1708	1591	1671	1591
q20	1966	1758	1776	1758
q21	4827	4714	4748	4714
q22	574	508	523	508
Total cold run time: 69936 ms
Total hot run time: 53716 ms

@doris-robot
Copy link

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

query1	920	386	383	383
query2	6476	2320	2251	2251
query3	6641	205	221	205
query4	20007	17524	17167	17167
query5	4169	483	487	483
query6	263	186	176	176
query7	4596	303	302	302
query8	301	290	263	263
query9	8617	2453	2441	2441
query10	584	303	284	284
query11	10529	9951	9954	9951
query12	135	88	88	88
query13	1651	365	375	365
query14	9690	7719	6924	6924
query15	222	189	186	186
query16	7716	270	263	263
query17	1898	527	524	524
query18	1789	279	274	274
query19	202	151	151	151
query20	91	83	82	82
query21	221	130	123	123
query22	4196	4133	3998	3998
query23	33605	33048	33322	33048
query24	12059	2843	2824	2824
query25	682	361	361	361
query26	1736	152	151	151
query27	2999	311	314	311
query28	7384	2111	2099	2099
query29	1059	621	601	601
query30	285	157	155	155
query31	970	740	791	740
query32	97	54	54	54
query33	769	290	287	287
query34	1016	472	482	472
query35	736	623	625	623
query36	1065	959	943	943
query37	280	68	76	68
query38	2879	2741	2736	2736
query39	884	795	821	795
query40	282	126	125	125
query41	53	46	44	44
query42	119	101	104	101
query43	590	551	552	551
query44	1191	721	735	721
query45	193	164	164	164
query46	1060	730	699	699
query47	1815	1765	1796	1765
query48	390	289	303	289
query49	1209	406	412	406
query50	770	390	401	390
query51	6795	6817	6818	6817
query52	106	96	96	96
query53	365	306	303	303
query54	1005	466	454	454
query55	76	77	117	77
query56	287	267	291	267
query57	1173	1044	1034	1034
query58	249	244	267	244
query59	3464	3447	3351	3351
query60	313	276	287	276
query61	90	96	90	90
query62	663	439	446	439
query63	325	294	299	294
query64	9865	2256	1728	1728
query65	3147	3107	3100	3100
query66	1372	343	329	329
query67	15370	14852	14845	14845
query68	4485	547	555	547
query69	576	417	368	368
query70	1201	1096	1158	1096
query71	442	284	285	284
query72	6969	5465	5342	5342
query73	755	331	329	329
query74	5864	5525	5393	5393
query75	3572	2693	2693	2693
query76	3159	924	887	887
query77	658	317	317	317
query78	10239	9843	9860	9843
query79	2580	510	520	510
query80	1397	468	477	468
query81	559	222	225	222
query82	746	117	103	103
query83	198	166	169	166
query84	274	89	82	82
query85	1452	285	283	283
query86	427	318	274	274
query87	3282	3098	3144	3098
query88	4042	2455	2478	2455
query89	474	381	389	381
query90	1900	190	188	188
query91	129	101	101	101
query92	66	50	51	50
query93	3523	516	501	501
query94	1164	190	191	190
query95	404	318	326	318
query96	622	272	277	272
query97	3239	3038	3073	3038
query98	232	197	197	197
query99	1239	846	838	838
Total cold run time: 277625 ms
Total hot run time: 172985 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.08	0.04	0.04
query3	0.22	0.05	0.06
query4	1.67	0.08	0.08
query5	0.51	0.48	0.48
query6	1.14	0.72	0.71
query7	0.02	0.01	0.01
query8	0.05	0.05	0.04
query9	0.54	0.49	0.48
query10	0.54	0.53	0.53
query11	0.15	0.11	0.11
query12	0.15	0.12	0.11
query13	0.59	0.58	0.59
query14	0.78	0.77	0.78
query15	0.85	0.81	0.82
query16	0.36	0.37	0.35
query17	0.99	0.96	0.97
query18	0.23	0.27	0.23
query19	1.74	1.74	1.74
query20	0.01	0.01	0.02
query21	15.44	0.74	0.66
query22	3.54	7.16	2.32
query23	18.28	1.38	1.21
query24	2.16	0.22	0.21
query25	0.17	0.08	0.08
query26	0.26	0.17	0.18
query27	0.08	0.07	0.09
query28	13.24	1.00	0.98
query29	12.67	3.31	3.28
query30	0.26	0.06	0.05
query31	2.89	0.38	0.40
query32	3.26	0.47	0.48
query33	2.88	2.88	2.95
query34	17.25	4.43	4.44
query35	4.48	4.51	4.45
query36	0.65	0.46	0.47
query37	0.18	0.16	0.15
query38	0.15	0.14	0.15
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: 108.89 s
Total hot run time: 30.81 s

@LiBinfeng-01
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17615	4933	4307	4307
q2	2023	191	196	191
q3	10453	1161	1167	1161
q4	10192	841	677	677
q5	7500	2627	2610	2610
q6	224	138	132	132
q7	957	599	611	599
q8	9222	2080	2088	2080
q9	8722	6517	6483	6483
q10	8890	3763	3720	3720
q11	459	231	231	231
q12	535	235	218	218
q13	17773	2983	2965	2965
q14	261	215	206	206
q15	520	486	480	480
q16	520	373	375	373
q17	961	596	703	596
q18	8003	7475	7307	7307
q19	5595	1286	1484	1286
q20	653	335	322	322
q21	5007	3105	3899	3105
q22	398	334	339	334
Total cold run time: 116483 ms
Total hot run time: 39383 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4389	4225	4207	4207
q2	365	266	259	259
q3	2998	2803	2882	2803
q4	2036	1761	1703	1703
q5	5596	5502	5491	5491
q6	214	128	128	128
q7	2171	1865	1874	1865
q8	3275	3390	3438	3390
q9	8696	8640	8813	8640
q10	4075	3882	3721	3721
q11	591	496	479	479
q12	834	658	638	638
q13	15773	3143	3146	3143
q14	301	280	261	261
q15	549	482	495	482
q16	500	433	429	429
q17	1798	1481	1482	1481
q18	8115	7919	7798	7798
q19	1841	1519	1564	1519
q20	3036	1942	1863	1863
q21	5267	4892	4907	4892
q22	648	558	596	558
Total cold run time: 73068 ms
Total hot run time: 55750 ms

@doris-robot
Copy link

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

query1	917	381	368	368
query2	6482	2451	2509	2451
query3	6639	205	208	205
query4	22783	17488	17336	17336
query5	3695	481	471	471
query6	263	170	188	170
query7	4610	305	292	292
query8	344	292	289	289
query9	8444	2413	2397	2397
query10	564	303	278	278
query11	10748	10146	10008	10008
query12	117	85	87	85
query13	1628	363	355	355
query14	10078	6381	7554	6381
query15	234	188	182	182
query16	7728	273	262	262
query17	1395	543	522	522
query18	1775	274	272	272
query19	193	149	146	146
query20	88	84	81	81
query21	212	125	127	125
query22	4422	4075	3920	3920
query23	33963	33734	33604	33604
query24	11249	2873	2810	2810
query25	632	398	378	378
query26	1180	154	157	154
query27	2378	323	322	322
query28	7329	2202	2180	2180
query29	925	631	635	631
query30	267	160	154	154
query31	978	739	752	739
query32	88	52	54	52
query33	750	282	283	282
query34	1016	493	481	481
query35	760	631	659	631
query36	1134	991	983	983
query37	141	75	72	72
query38	2949	2901	2860	2860
query39	879	864	839	839
query40	218	131	127	127
query41	56	56	54	54
query42	117	109	102	102
query43	597	578	519	519
query44	1227	735	734	734
query45	199	162	171	162
query46	1097	712	702	702
query47	1855	1821	1800	1800
query48	364	302	298	298
query49	846	419	423	419
query50	780	388	387	387
query51	6849	6806	6764	6764
query52	139	94	94	94
query53	372	300	291	291
query54	895	448	447	447
query55	74	74	76	74
query56	282	272	275	272
query57	1128	1045	1082	1045
query58	250	240	281	240
query59	3312	3335	3231	3231
query60	299	283	283	283
query61	104	95	96	95
query62	621	438	434	434
query63	320	281	289	281
query64	8859	2310	1742	1742
query65	3207	3102	3086	3086
query66	741	322	328	322
query67	15440	14974	14734	14734
query68	6121	549	543	543
query69	620	465	372	372
query70	1189	1148	1163	1148
query71	495	272	264	264
query72	7299	5469	5752	5469
query73	805	329	323	323
query74	6010	5499	5507	5499
query75	3706	2652	2698	2652
query76	3357	959	923	923
query77	600	304	304	304
query78	10556	9859	9815	9815
query79	1903	509	517	509
query80	1301	483	459	459
query81	578	224	220	220
query82	421	103	101	101
query83	192	172	168	168
query84	270	83	85	83
query85	968	277	270	270
query86	370	307	314	307
query87	3327	3091	3119	3091
query88	3725	2369	2362	2362
query89	478	378	384	378
query90	1796	195	189	189
query91	128	99	103	99
query92	59	48	48	48
query93	3427	525	520	520
query94	1185	189	191	189
query95	403	315	338	315
query96	605	268	266	266
query97	3212	3068	3074	3068
query98	216	198	202	198
query99	1188	840	845	840
Total cold run time: 276735 ms
Total hot run time: 173499 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.04
query2	0.08	0.04	0.04
query3	0.22	0.05	0.05
query4	1.68	0.07	0.10
query5	0.50	0.50	0.47
query6	1.14	0.74	0.73
query7	0.02	0.02	0.02
query8	0.05	0.04	0.05
query9	0.56	0.52	0.49
query10	0.55	0.54	0.54
query11	0.15	0.12	0.12
query12	0.14	0.12	0.12
query13	0.59	0.59	0.60
query14	0.76	0.77	0.78
query15	0.83	0.81	0.81
query16	0.35	0.37	0.35
query17	0.97	0.98	0.97
query18	0.22	0.24	0.20
query19	1.80	1.65	1.72
query20	0.01	0.01	0.01
query21	15.43	0.75	0.67
query22	4.37	6.84	2.07
query23	18.32	1.42	1.26
query24	2.08	0.23	0.21
query25	0.16	0.08	0.08
query26	0.26	0.17	0.18
query27	0.08	0.07	0.08
query28	13.25	1.03	1.00
query29	12.68	3.34	3.31
query30	0.26	0.06	0.07
query31	2.91	0.40	0.38
query32	3.27	0.47	0.49
query33	2.84	2.91	2.88
query34	17.24	4.44	4.45
query35	4.53	4.53	4.54
query36	0.65	0.45	0.47
query37	0.18	0.15	0.15
query38	0.16	0.14	0.14
query39	0.04	0.03	0.04
query40	0.16	0.16	0.16
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.74 s
Total hot run time: 30.75 s

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

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

@englefly englefly merged commit 67888a4 into apache:master Jun 27, 2024
dataroaring pushed a commit that referenced this pull request Jun 28, 2024
Add feat of force use/nouse cbo rule hint

introduce
when not using this hint, cbo rules like INFER_SET_OPERATOR_DISTINCT would generate two plans and compare their cost
and nereids optimizer would decide which is better. But when we want to control the behavior of cbo rules we could use this force cbo rule hint
usage example
explain shape plan
select /*+ USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) */
*
from t1
union
select * from t2;
the USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) hint would force rule INFER_SET_OPERATOR_DISTINCT to be used
and generate plan like, which hashAgg below union is generated by this rule:

-- !with_hint_union_distinct --
----hashAgg[GLOBAL]
--------hashAgg[LOCAL]
----------PhysicalUnion
--------------hashAgg[LOCAL]
----------------PhysicalOlapScan[t1]
--------------hashAgg[LOCAL]
----------------PhysicalOlapScan[t2]
Hint log:
Used: INFER_SET_OPERATOR_DISTINCT
UnUsed:
SyntaxError:
When we want to force disable this rule, we could use

explain shape plan select /*+ NO_USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) */ * from t1 union select * from t2;
which would generate plan with this rule:

-- !with_hint_no_union_distinct --
----hashAgg[GLOBAL]
--------hashAgg[LOCAL]
----------PhysicalUnion
--------------PhysicalOlapScan[t1]
--------------PhysicalOlapScan[t2]
Hint log:
Used: NO_INFER_SET_OPERATOR_DISTINCT
UnUsed:
SyntaxError:
change sessionvariable enableNereidsRules to varType.remove
morrySnow pushed a commit that referenced this pull request Aug 23, 2024
…39715)

use_cbo_rule_hint show used but it does not be used
intro by: #35925
dataroaring pushed a commit that referenced this pull request Sep 26, 2024
…39715)

use_cbo_rule_hint show used but it does not be used
intro by: #35925
LiBinfeng-01 added a commit to LiBinfeng-01/doris that referenced this pull request Oct 15, 2024
Add feat of force use/nouse cbo rule hint

introduce
when not using this hint, cbo rules like INFER_SET_OPERATOR_DISTINCT would generate two plans and compare their cost
and nereids optimizer would decide which is better. But when we want to control the behavior of cbo rules we could use this force cbo rule hint
usage example
explain shape plan
select /*+ USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) */
*
from t1
union
select * from t2;
the USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) hint would force rule INFER_SET_OPERATOR_DISTINCT to be used
and generate plan like, which hashAgg below union is generated by this rule:

-- !with_hint_union_distinct --
----hashAgg[GLOBAL]
--------hashAgg[LOCAL]
----------PhysicalUnion
--------------hashAgg[LOCAL]
----------------PhysicalOlapScan[t1]
--------------hashAgg[LOCAL]
----------------PhysicalOlapScan[t2]
Hint log:
Used: INFER_SET_OPERATOR_DISTINCT
UnUsed:
SyntaxError:
When we want to force disable this rule, we could use

explain shape plan select /*+ NO_USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) */ * from t1 union select * from t2;
which would generate plan with this rule:

-- !with_hint_no_union_distinct --
----hashAgg[GLOBAL]
--------hashAgg[LOCAL]
----------PhysicalUnion
--------------PhysicalOlapScan[t1]
--------------PhysicalOlapScan[t2]
Hint log:
Used: NO_INFER_SET_OPERATOR_DISTINCT
UnUsed:
SyntaxError:
change sessionvariable enableNereidsRules to varType.remove
LiBinfeng-01 added a commit to LiBinfeng-01/doris that referenced this pull request Oct 15, 2024
morrySnow pushed a commit that referenced this pull request Oct 17, 2024
…#41869)

pick: #35925 #39715 #40167 #40958
Add feat of force use/nouse cbo rule hint and fix pr

introduce
when not using this hint, cbo rules like INFER_SET_OPERATOR_DISTINCT
would generate two plans and compare their cost
and nereids optimizer would decide which is better. But when we want to
control the behavior of cbo rules we could use this force cbo rule hint
usage example
explain shape plan
select /*+ USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) */
*
from t1
union
select * from t2;
the USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) hint would force rule
INFER_SET_OPERATOR_DISTINCT to be used
and generate plan like, which hashAgg below union is generated by this
rule:

-- !with_hint_union_distinct --
----hashAgg[GLOBAL]
--------hashAgg[LOCAL]
----------PhysicalUnion
--------------hashAgg[LOCAL]
----------------PhysicalOlapScan[t1]
--------------hashAgg[LOCAL]
----------------PhysicalOlapScan[t2]
Hint log:
Used: INFER_SET_OPERATOR_DISTINCT
UnUsed:
SyntaxError:
When we want to force disable this rule, we could use
explain shape plan select /*+
NO_USE_CBO_RULE(INFER_SET_OPERATOR_DISTINCT) */ * from t1 union select *
from t2;
which would generate plan with this rule:

-- !with_hint_no_union_distinct --
----hashAgg[GLOBAL]
--------hashAgg[LOCAL]
----------PhysicalUnion
--------------PhysicalOlapScan[t1]
--------------PhysicalOlapScan[t2]
Hint log:
Used: NO_INFER_SET_OPERATOR_DISTINCT
UnUsed:
SyntaxError:
change sessionvariable enableNereidsRules to varType.remove
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/2.1.7-merged dev/3.0.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants