Skip to content

Conversation

@ZiheLiu
Copy link
Contributor

@ZiheLiu ZiheLiu commented May 20, 2025

Why I'm doing:

Introduced by #30386.

The result queue capacity is dop*2.

However, this dop is get by state->query_options().pipeline_dop, which is the raw value of the session variable pipeline_dop (0 by default).

This results that the queue capacity is 0, which means the queue will be full after putting one result batch. And therefore, result sink can only buffer one chunk.

Test

16Core 64GB Memory BE.

select k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1,k1 
from d1.__row_util_base 
limit 100000000

ResultDeliverTime:

  • Before: 35s139ms
  • After: 17s432ms

ResultDeliverTime is decreased, but the total execution time between these two versions are the same.

What I'm doing:

Use actual DOP to set queue capacity.

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.5
    • 3.4
    • 3.3
    • 3.2
    • 3.1

Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
@ZiheLiu ZiheLiu requested a review from a team as a code owner May 20, 2025 09:26
@github-actions
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link

[BE Incremental Coverage Report]

pass : 3 / 3 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/exec/pipeline/result_sink_operator.h 2 2 100.00% []
🔵 be/src/exec/data_sink.cpp 1 1 100.00% []

Copy link
Contributor

@alvin-celerdata alvin-celerdata left a comment

Choose a reason for hiding this comment

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

LGTM
Could you elaborate a little more on the influence of query in the commit message? Will the performance be influenced?
I'm not very sure about the consequence of one slot in the buffer.

@ZiheLiu
Copy link
Contributor Author

ZiheLiu commented May 22, 2025

@alvin-celerdata Added a performance test in the description. ResultDeliverTime is decreased, but the total execution time between these two versions are the same.

@satanson satanson merged commit 0ccc306 into StarRocks:main May 22, 2025
162 checks passed
@github-actions
Copy link

@Mergifyio backport branch-3.3

@github-actions
Copy link

@Mergifyio backport branch-3.5

@github-actions github-actions bot removed the 3.3 label May 22, 2025
@github-actions
Copy link

@Mergifyio backport branch-3.4

@mergify
Copy link
Contributor

mergify bot commented May 22, 2025

backport branch-3.3

✅ Backports have been created

Details

@mergify
Copy link
Contributor

mergify bot commented May 22, 2025

backport branch-3.5

✅ Backports have been created

Details

@mergify
Copy link
Contributor

mergify bot commented May 22, 2025

backport branch-3.4

✅ Backports have been created

Details

mergify bot pushed a commit that referenced this pull request May 22, 2025
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
(cherry picked from commit 0ccc306)

# Conflicts:
#	be/src/exec/data_sink.cpp
mergify bot pushed a commit that referenced this pull request May 22, 2025
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
(cherry picked from commit 0ccc306)
mergify bot pushed a commit that referenced this pull request May 22, 2025
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
(cherry picked from commit 0ccc306)
wanpengfei-git pushed a commit that referenced this pull request May 22, 2025
…59260)

Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
Co-authored-by: zihe.liu <ziheliu1024@gmail.com>
wanpengfei-git pushed a commit that referenced this pull request May 22, 2025
…59261)

Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
Co-authored-by: zihe.liu <ziheliu1024@gmail.com>
wanpengfei-git pushed a commit that referenced this pull request Jun 9, 2025
…59259)

Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
Co-authored-by: zihe.liu <ziheliu1024@gmail.com>
AntiTopQuark pushed a commit to AntiTopQuark/starrocks that referenced this pull request Jun 19, 2025
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
Signed-off-by: AntiTopQuark <AntiTopQuark1350@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants