guicheng.cai
12/02/2025, 11:35 AMclickhouse-client, which directly displays query execution time.)
Why did StarRocks take longer in this test? Are there potential issues with the testing approach? Do you have any suggestions for improvement?
Looking forward to your suggestions.
Thanks a lot.Евгений Шишкин
12/02/2025, 12:15 PMguicheng.cai
12/02/2025, 12:54 PMЕвгений Шишкин
12/02/2025, 1:16 PMguicheng.cai
12/02/2025, 1:32 PMparallel_fragment_exec_instance_num=1,max_parallel_scan_instance_num=-1,pipeline_dop=0,
Total: 12s115msЕвгений Шишкин
12/02/2025, 1:40 PMЕвгений Шишкин
12/02/2025, 1:46 PMЕвгений Шишкин
12/02/2025, 1:49 PMexplain analyze so that we dont wait for the network?guicheng.cai
12/02/2025, 1:53 PMЕвгений Шишкин
12/02/2025, 2:09 PMЕвгений Шишкин
12/02/2025, 2:14 PMKevin Cai
12/02/2025, 2:30 PMcreate table xxx as select ... to save the selected result to a table and see how much time it will cost.
2. global order by in the final result is costy due to single-threaded merge of the final 3.3 million records. Have a try remove the order by, if the query costs changes.guicheng.cai
12/03/2025, 2:15 AM日期 DESC, device;" at the end of SQL?Kevin Cai
12/03/2025, 2:16 AMguicheng.cai
12/03/2025, 2:19 AMguicheng.cai
12/03/2025, 3:32 AMcreate table xxx as select ... to save the selected result to a table , and the query profile as follow:
Query:
Summary:
- Query ID: 019ae236-e105-7a10-99fa-7e860e50d692
- Start Time: 2025-12-03 03:17:18
- End Time: 2025-12-03 03:17:33
- Total: 15s192ms
- Query Type: Query
- Query State: Finished
- StarRocks Version: 4.0.1-cd9df36
- User: root
- Default Db
- Sql Statement: CREATE TABLE trancare_ads.ads_perf_lch_google_app_launch_stage_di_tmp_test
PROPERTIES ("replication_num" = "1")
AS
SELECT
ta.tos AS tos,
ta.rom_vr AS rom_vr,
ta.os_vr AS os_vr,
ta.device AS device,
ta.brand AS brand,
ta.cpu AS cpu,
...
LOCAL_MERGE_SOURCE (plan_node_id=17):
CommonMetrics:
- OperatorTotalTime: 11s893ms
- OutputChunkBytes: 1.302 GB
- PullChunkNum: 832
- PullRowNum: 3.362M (3362123)
- PullTotalTime: 11s892ms
- PushChunkNum: 0
- PushRowNum: 0
- PushTotalTime: 0ns
2、Removing the "ORDER BY 日期 DESC, device;" at the end of SQL, The executed query profile is shown in the attachment.
By the way, the performance has indeed improved a lot after the removal of "order by", but in actual business applications, "order by" may be required. How can this be optimized?Kevin Cai
12/03/2025, 3:36 AMguicheng.cai
12/03/2025, 3:47 AM- Total: 9s63ms
LOCAL_MERGE_SOURCE (plan_node_id=17):
CommonMetrics:
- OperatorTotalTime: 7s460ms
- OutputChunkBytes: 1.302 GB
- PullChunkNum: 832
- PullRowNum: 3.362M (3362123)
- PullTotalTime: 7s460ms
pipeline_dop = 8:
- Total: 7s602ms
LOCAL_MERGE_SOURCE (plan_node_id=17):
CommonMetrics:
- OperatorTotalTime: 5s597ms
- OutputChunkBytes: 1.302 GB
- PullChunkNum: 824
- PullRowNum: 3.362M (3362123)
- PullTotalTime: 5s597ms
pipeline_dop = 4:
- Total: 7s19ms
LOCAL_MERGE_SOURCE (plan_node_id=17):
CommonMetrics:
- OperatorTotalTime: 3s774ms
- OutputChunkBytes: 1.302 GB
- PullChunkNum: 824
- PullRowNum: 3.362M (3362123)
- PullTotalTime: 3s774ms
pipeline_dop = 2:
- Total: 10s571ms
LOCAL_MERGE_SOURCE (plan_node_id=17):
CommonMetrics:
- OperatorTotalTime: 5s478ms
- OutputChunkBytes: 1.302 GB
- PullChunkNum: 823
- PullRowNum: 3.362M (3362123)
- PullTotalTime: 5s478ms
By the way, shouldn't there be a cache after the first selection? Why does it take the same time for the same environment and query conditions to execute each time?Евгений Шишкин
12/03/2025, 5:24 AMguicheng.cai
12/03/2025, 5:52 AMparallel_fragment_exec_instance_num and `pipeline_dop`—to achieve optimal query performance?Евгений Шишкин
12/03/2025, 5:54 AMguicheng.cai
12/03/2025, 6:12 AMpipeline_dop appears to be 4 in this case.
Could you please advise if there is someone in the community who specializes in this area — particularly regarding LOCAL_MERGE_SOURCE performance and parallel merge mechanisms? If possible, I would appreciate an introduction or if you could forward this case to them for further insight on how to optimize or resolve the merge speed issue.
We have already tried adjusting parallel_fragment_exec_instance_num and pipeline_dop, but it seems we are still not achieving the expected parallelism on a 96-core server. Any guidance on how to better utilize system resources or configure parallel merging would be very helpful.Евгений Шишкин
12/03/2025, 9:03 AMЕвгений Шишкин
12/03/2025, 9:10 AMguicheng.cai
12/03/2025, 10:09 AMЕвгений Шишкин
12/03/2025, 11:46 AMЕвгений Шишкин
12/03/2025, 9:15 PMЕвгений Шишкин
12/03/2025, 9:28 PMguicheng.cai
12/04/2025, 2:25 AMЕвгений Шишкин
12/04/2025, 5:58 AMЕвгений Шишкин
12/04/2025, 6:34 AMЕвгений Шишкин
12/04/2025, 8:34 AMЕвгений Шишкин
12/04/2025, 11:34 AMЕвгений Шишкин
12/04/2025, 11:36 AMЕвгений Шишкин
12/04/2025, 12:04 PMЕвгений Шишкин
12/04/2025, 2:30 PMguicheng.cai
12/05/2025, 9:12 AMЕвгений Шишкин
12/05/2025, 9:15 AMЕвгений Шишкин
12/05/2025, 9:16 AM