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

[opt](nereids)adjust distribution cost for better choice of broadcast join and shuffle join #27113

Merged
merged 5 commits into from
Nov 28, 2023

Conversation

englefly
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@englefly englefly changed the title adjust distribute cost [opt](nereids)adjust distribution cost for better choice of broadcast join and shuffle join Nov 17, 2023
@englefly englefly marked this pull request as ready for review November 18, 2023 11:57
@englefly
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
Tpch sf100 test result on commit 3eef262876691ea82c12b976deb334e91498ac23, data reload: false

run tpch-sf100 query with default conf and session variables
q1	4923	4686	4651	4651
q2	355	158	158	158
q3	2051	1973	1958	1958
q4	1401	1282	1246	1246
q5	3874	3840	3933	3840
q6	253	133	130	130
q7	1367	863	873	863
q8	2737	2736	2720	2720
q9	7478	7509	7537	7509
q10	3420	3498	3506	3498
q11	371	242	249	242
q12	430	299	290	290
q13	4525	3786	3778	3778
q14	310	297	285	285
q15	587	521	520	520
q16	489	461	452	452
q17	1140	985	958	958
q18	8085	7412	7413	7412
q19	1674	1652	1664	1652
q20	1732	306	287	287
q21	4470	4014	4038	4014
q22	1126	388	382	382
Total cold run time: 52798 ms
Total hot run time: 46845 ms

run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
q1	4583	4566	4623	4566
q2	319	226	234	226
q3	3894	3874	3841	3841
q4	2709	2713	2700	2700
q5	9683	9635	9731	9635
q6	248	124	125	124
q7	2927	2485	2517	2485
q8	4442	4427	4420	4420
q9	11534	11655	11595	11595
q10	7641	4139	4150	4139
q11	799	642	675	642
q12	984	819	819	819
q13	4255	3634	3597	3597
q14	380	345	362	345
q15	577	511	519	511
q16	591	553	556	553
q17	3904	3833	3794	3794
q18	9759	9255	9218	9218
q19	1801	1758	1776	1758
q20	2381	2053	2065	2053
q21	8909	8581	8684	8581
q22	889	770	807	770
Total cold run time: 83209 ms
Total hot run time: 76372 ms

@doris-robot
Copy link

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 44.72 seconds
stream load tsv: 571 seconds loaded 74807831229 Bytes, about 124 MB/s
stream load json: 18 seconds loaded 2358488459 Bytes, about 124 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 32 seconds loaded 861443392 Bytes, about 25 MB/s
insert into select: 28.9 seconds inserted 10000000 Rows, about 346K ops/s
storage size: 17099704290 Bytes

@englefly
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 44.29 seconds
stream load tsv: 565 seconds loaded 74807831229 Bytes, about 126 MB/s
stream load json: 18 seconds loaded 2358488459 Bytes, about 124 MB/s
stream load orc: 64 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 32 seconds loaded 861443392 Bytes, about 25 MB/s
insert into select: 27.9 seconds inserted 10000000 Rows, about 358K ops/s
storage size: 17101712376 Bytes

@doris-robot
Copy link

TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
Tpch sf100 test result on commit d06a75f053447ea264ce41322a3e73c53eabd507, data reload: false

run tpch-sf100 query with default conf and session variables
q1	4848	4647	4672	4647
q2	363	151	159	151
q3	2050	1904	1909	1904
q4	1397	1292	1294	1292
q5	3989	3922	4049	3922
q6	257	132	138	132
q7	1486	911	902	902
q8	2757	2807	2770	2770
q9	9764	9676	9619	9619
q10	10253	3556	3542	3542
q11	390	251	239	239
q12	452	295	311	295
q13	4567	3820	3837	3820
q14	321	284	299	284
q15	592	539	527	527
q16	666	582	587	582
q17	1125	945	923	923
q18	7774	7279	7406	7279
q19	1686	1660	1673	1660
q20	547	320	289	289
q21	4392	3978	4006	3978
q22	482	377	376	376
Total cold run time: 60158 ms
Total hot run time: 49133 ms

run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
q1	4583	4598	4575	4575
q2	344	224	267	224
q3	3993	3981	3988	3981
q4	2706	2686	2700	2686
q5	9589	9575	9615	9575
q6	249	128	131	128
q7	3023	2488	2471	2471
q8	4456	4427	4442	4427
q9	13155	13157	13113	13113
q10	4126	4190	4171	4171
q11	732	662	637	637
q12	984	840	830	830
q13	4311	3624	3607	3607
q14	374	344	346	344
q15	585	521	522	521
q16	745	675	666	666
q17	3848	3854	3878	3854
q18	9537	9315	9045	9045
q19	1843	1811	1792	1792
q20	2390	2042	2050	2042
q21	9038	8458	8449	8449
q22	895	830	821	821
Total cold run time: 81506 ms
Total hot run time: 77959 ms

@morrySnow morrySnow marked this pull request as draft November 23, 2023 11:08
@englefly
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
Tpch sf100 test result on commit 4116bb442da8eaa85269cce68dee942f9ceaf5f5, data reload: false

run tpch-sf100 query with default conf and session variables
q1	4908	4675	4641	4641
q2	356	166	159	159
q3	2050	1957	1970	1957
q4	1401	1309	1229	1229
q5	3950	3894	4014	3894
q6	249	124	129	124
q7	1343	839	878	839
q8	2786	2788	2796	2788
q9	9761	9679	9710	9679
q10	3458	3512	3496	3496
q11	390	253	245	245
q12	431	281	289	281
q13	4597	3842	3769	3769
q14	318	301	297	297
q15	590	520	517	517
q16	506	471	468	468
q17	1133	951	915	915
q18	7970	7476	7505	7476
q19	1665	1666	1699	1666
q20	580	310	275	275
q21	4429	3990	4023	3990
q22	465	365	364	364
Total cold run time: 53336 ms
Total hot run time: 49069 ms

run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
q1	4575	4559	4582	4559
q2	332	264	241	241
q3	4047	4040	4005	4005
q4	2717	2710	2702	2702
q5	9664	9634	9623	9623
q6	250	120	125	120
q7	2981	2481	2470	2470
q8	4445	4440	4466	4440
q9	12955	12828	12901	12828
q10	4042	4135	4135	4135
q11	806	706	659	659
q12	974	801	813	801
q13	4288	3543	3587	3543
q14	372	348	352	348
q15	565	517	528	517
q16	593	555	541	541
q17	3886	3846	3894	3846
q18	9784	9225	9232	9225
q19	1819	1789	1777	1777
q20	2364	2053	2064	2053
q21	8809	8666	8684	8666
q22	879	781	812	781
Total cold run time: 81147 ms
Total hot run time: 77880 ms

@doris-robot
Copy link

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.3 seconds
stream load tsv: 574 seconds loaded 74807831229 Bytes, about 124 MB/s
stream load json: 18 seconds loaded 2358488459 Bytes, about 124 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 32 seconds loaded 861443392 Bytes, about 25 MB/s
insert into select: 33.6 seconds inserted 10000000 Rows, about 297K ops/s
storage size: 17101384671 Bytes

@englefly
Copy link
Contributor Author

run buildall

@englefly englefly marked this pull request as ready for review November 24, 2023 13:20
eldenmoon pushed a commit to eldenmoon/incubator-doris that referenced this pull request Nov 27, 2023
@englefly
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.85 seconds
stream load tsv: 565 seconds loaded 74807831229 Bytes, about 126 MB/s
stream load json: 26 seconds loaded 2358488459 Bytes, about 86 MB/s
stream load orc: 71 seconds loaded 1101869774 Bytes, about 14 MB/s
stream load parquet: 32 seconds loaded 861443392 Bytes, about 25 MB/s
insert into select: 28.6 seconds inserted 10000000 Rows, about 349K ops/s
storage size: 17098825574 Bytes

eldenmoon added a commit that referenced this pull request Nov 27, 2023
* [fix](stats) Fix update rows for unique table didn't get updated properly #26968 (#27337)

* [FIX](jsonb) fix jsonb in predict column #27325 (#27424)

* [fix](fe) slots in having clause should be set to need materialized(#27412) (#27429)

* [Bug](insert)fix insert wrong data on mv when stmt have multiple values (#27297) (#27382)

fix insert wrong data on mv when stmt have multiple values

* [fix](fe ut) Fix OlapQueryCacheTest failed (#27305) (#27406)

1.
```
java.lang.NullPointerException: null
        at org.apache.doris.catalog.Env.getCurrentSystemInfo(Env.java:793) ~[classes/:?]
        at org.apache.doris.qe.SimpleScheduler$UpdateBlacklistThread.run(SimpleScheduler.java:206) ~[classes/:?]
        at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_382]

java.lang.NullPointerException
        at org.apache.doris.qe.OlapQueryCacheTest.setUp(OlapQueryCacheTest.java:226)
```

2.
```
[ERROR] testSqlCacheKeyWithNestedViewForNereids  Time elapsed: 1.962 s  <<< FAILURE!
java.lang.AssertionError: SELECT command denied to user 'testCluster:testUser'@'192.168.1.1' for table 'internal: testCluster:testDb: appevent'
	at org.apache.doris.qe.OlapQueryCacheTest.parseSqlByNereids(OlapQueryCacheTest.java:579)
	at org.apache.doris.qe.OlapQueryCacheTest.testSqlCacheKeyWithNestedViewForNereids(OlapQueryCacheTest.java:1338)
```

3.
```
[ERROR] Tests run: 28, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 113.63 s <<< FAILURE! - in org.apache.doris.qe.OlapQueryCacheTest
[ERROR] testCacheModeTable  Time elapsed: 1.657 s  <<< ERROR!
java.lang.IllegalArgumentException: Value of type org.apache.doris.qe.QueryState incompatible with return type org.apache.doris.system.SystemInfoService of org.apache.doris.catalog.Env#getCurrentSystemInfo()
        at org.apache.doris.qe.OlapQueryCacheTest.setUp(OlapQueryCacheTest.java:156)
```

* [regression test](schema change) add some schema change regression cases (#27112) (#27418)

* [fix](Nereids) result type of add precision is 1 more than expected (#27136) (#27426)

* [fix](Nereids): fill miss slot in having subquery (#27177) (#27394)

* [fix](memory) Fix make_top_consumption_snapshots heap-use-after-free #27434 (#27465)

* [fix](function) make TIMESTAMP function DEPEND_ON_ARGUMENT (#27343) (#27458)

* [fix](test) order by clause in test_map(#27390) (#27391)

pick #27390

* [performance](Planner): optimize getStringValue() in DateLiteral (#27363) (#27470)

- reduce cost of `getStringValue()`
- original code don't consider `microsecond` part in `getStringValue()`

(cherry picked from commit 044a295)

* [Chore](pick) do not push down agg on aggregate column (#27356) (#27498)

* [fix](stats) table not exists error msg not print objects name #27074 (#27463)

* [improve](nereids) support agg function of count(const value) pushdown #26677 (#27499)

support sql: select count(1)-count(not null) from table, the agg of count could push down.

* [test](fe-ut) fix unstable MysqlServerTest (#27459)

Need to find a unbind port for MysqlServerTest

* [opt](MergedIO) no need to merge large columns (#27315) (#27497)

1. Fix a profile bug of `MergeRangeFileReader`, and add a profile `ApplyBytes` to show the total bytes  of ranges.
2. There's no need to merge large columns, because `MergeRangeFileReader` will increase the copy time.

* [improvement](drop tablet)  impr gc shutdown tablet lock (#26151) (#27478)

* [doc](stats) SQL manual for stats (#27461)

* [chore](merge-on-write) disable rowid conversion check for mow table by default (#27482) (#27508)

* [fix](regression)Fix hive p2 case (#27466) (#27511)

* [fix](statistics)Fix auto analyze remove finished job bug #27486 (#27510)

* [Bug](bitmap) Fix heap-use-after-free in the bitmap functions #27411 (#27521)

* [Pick](nereids) Pick: partition prune fails in case of NOT expression (#27047) (#27507)

* [fix](clone) Fix engine_clone file exist (#27361) (#27536)

* [chore](case) adjust timeout of broker load case #27540

* Fix auto analyze doesn't filter unsupported type bug. (#27547)

Fix auto analyze doesn't filter unsupported type bug.
Catch throwable in auto analyze thread for each database, otherwise the thread will quit when one database failed to create jobs and all other databases will not get analyzed.
change FE config item full_auto_analyze_simultaneously_running_task_num to auto_analyze_simultaneously_running_task_num
backport #27559

* [chore](fe plugin) Upgrade dependency to doris 2.0-SNAPSHOT #27522 (#27558)

* [Bug](materialized-view) add limitation for duplicate expr on materialized view (#27523) (#27562)

* [fix](planner)join node should output required slot from parent node #27526 (#27551)

* [branch-2.0](hive) enable hive view by default (#27550)

* [pick](nereids) adjust bc join and shuffle join #27113 (#27566)

* [Fix](hive-transactional-table) Fix NPE when query empty hive transactional table. (#27567)

---------

Co-authored-by: AKIRA <33112463+Kikyou1997@users.noreply.github.com>
Co-authored-by: amory <wangqiannan@selectdb.com>
Co-authored-by: Jerry Hu <mrhhsg@gmail.com>
Co-authored-by: Pxl <pxl290@qq.com>
Co-authored-by: Xinyi Zou <zouxinyi02@gmail.com>
Co-authored-by: Luwei <814383175@qq.com>
Co-authored-by: morrySnow <101034200+morrySnow@users.noreply.github.com>
Co-authored-by: 谢健 <jianxie0@gmail.com>
Co-authored-by: Mryange <59914473+Mryange@users.noreply.github.com>
Co-authored-by: jakevin <jakevingoo@gmail.com>
Co-authored-by: zhangstar333 <87313068+zhangstar333@users.noreply.github.com>
Co-authored-by: Mingyu Chen <morningman@163.com>
Co-authored-by: Ashin Gau <AshinGau@users.noreply.github.com>
Co-authored-by: yujun <yu.jun.reach@gmail.com>
Co-authored-by: Xin Liao <liaoxinbit@126.com>
Co-authored-by: Jibing-Li <64681310+Jibing-Li@users.noreply.github.com>
Co-authored-by: xy720 <22125576+xy720@users.noreply.github.com>
Co-authored-by: minghong <englefly@gmail.com>
Co-authored-by: Jack Drogon <jack.xsuperman@gmail.com>
Co-authored-by: Dongyang Li <hello_stephen@qq.com>
Co-authored-by: zhiqiang <seuhezhiqiang@163.com>
Co-authored-by: starocean999 <40539150+starocean999@users.noreply.github.com>
Co-authored-by: Qi Chen <kaka11.chen@gmail.com>
@doris-robot
Copy link

TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
Tpch sf100 test result on commit 6360b29f8ad3ea60641a1c7cee869819f40ff9e0, data reload: false

run tpch-sf100 query with default conf and session variables
q1	4935	4644	4697	4644
q2	359	161	161	161
q3	2062	1939	1928	1928
q4	1399	1267	1255	1255
q5	3993	3955	4031	3955
q6	256	137	130	130
q7	1341	851	833	833
q8	2804	2821	2798	2798
q9	9820	9739	9628	9628
q10	3452	3542	3531	3531
q11	384	239	250	239
q12	437	290	301	290
q13	4552	3823	3817	3817
q14	333	284	304	284
q15	589	523	525	523
q16	495	452	459	452
q17	1147	979	966	966
q18	7983	7478	7476	7476
q19	1678	1694	1680	1680
q20	530	314	305	305
q21	4473	4045	4032	4032
q22	475	375	386	375
Total cold run time: 53497 ms
Total hot run time: 49302 ms

run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
q1	4596	4577	4600	4577
q2	340	217	244	217
q3	4036	4041	4035	4035
q4	2718	2736	2708	2708
q5	9595	9650	9672	9650
q6	246	127	125	125
q7	2996	2443	2493	2443
q8	4427	4414	4438	4414
q9	13248	13157	13260	13157
q10	4047	4161	4136	4136
q11	771	663	657	657
q12	975	823	801	801
q13	4289	3554	3560	3554
q14	384	348	360	348
q15	566	525	522	522
q16	586	572	587	572
q17	3935	3859	3816	3816
q18	9610	9161	9216	9161
q19	1787	1777	1782	1777
q20	2424	2069	2047	2047
q21	8901	8677	8709	8677
q22	876	791	795	791
Total cold run time: 81353 ms
Total hot run time: 78185 ms

Copy link
Contributor

PR approved by anyone and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 28, 2023
Copy link
Contributor

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

@englefly englefly merged commit 9903c30 into apache:master Nov 28, 2023
30 of 31 checks passed
@englefly englefly deleted the bc-pj branch November 28, 2023 02:41
gnehil pushed a commit to gnehil/doris that referenced this pull request Dec 4, 2023
@xiaokang xiaokang mentioned this pull request Dec 4, 2023
XuJianxu pushed a commit to XuJianxu/doris that referenced this pull request Dec 14, 2023
… join and shuffle join (apache#27113)

add boundary to distribution cost factor
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.0.3-merged p0_b reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants