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(query): sort kernel optimization #16458

Merged
merged 11 commits into from
Sep 18, 2024
Merged

Conversation

sundy-li
Copy link
Member

@sundy-li sundy-li commented Sep 15, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  1. Introduce ColumnVisitor trait and SortCompare
  2. Optimize kernel sort performance (Now we are using column vertical sort, which removes virtual call in sort compare functions)

Sort Performance with 2~3 order column test example, gain about 40%~50%

select l_partkey, l_returnflag from (select * from tpch_test.lineitem limit 10000000) order by l_partkey desc, l_returnflag asc ignore_result;

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Sep 15, 2024
@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Sep 15, 2024
@dosubot dosubot bot added A-query Area: databend query C-performance Category: Performance labels Sep 15, 2024
@sundy-li sundy-li marked this pull request as draft September 15, 2024 04:25
@sundy-li sundy-li marked this pull request as ready for review September 18, 2024 01:05
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 18, 2024
Copy link
Collaborator

@forsaken628 forsaken628 left a comment

Choose a reason for hiding this comment

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

Reviewed 24 of 26 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @sundy-li)

@sundy-li sundy-li added this pull request to the merge queue Sep 18, 2024
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Sep 18, 2024
@BohuTANG BohuTANG merged commit 3605978 into databendlabs:main Sep 18, 2024
81 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query Area: databend query C-performance Category: Performance lgtm This PR has been approved by a maintainer pr-refactor this PR changes the code base without new features or bugfix size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants