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

feat(query): refactor window spill #16448

Merged
merged 38 commits into from
Sep 19, 2024

Conversation

Dousir9
Copy link
Member

@Dousir9 Dousir9 commented Sep 12, 2024

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

Summary

截屏2024-09-17 23 52 57

Performance Test (Databend Cloud Small) (TPC-H SF100)

Spill Query Duration: 98s → 58s (68%)
No Spill Query Duration(set window_partition_spilling_memory_ratio = 0): 25s -> 25s

Full Test Script

set max_memory_usage = 34359738368; -- 32GB
set window_partition_spilling_memory_ratio = 60;
SELECT
    l_orderkey,
    l_partkey,
    l_quantity,
    l_extendedprice,
    ROW_NUMBER() OVER (PARTITION BY l_orderkey ORDER BY l_extendedprice DESC) AS row_num,
    RANK() OVER (PARTITION BY l_orderkey ORDER BY l_extendedprice DESC) AS rank_num,
    SUM(l_extendedprice) OVER (PARTITION BY l_orderkey ORDER BY l_extendedprice DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_sum
FROM
    lineitem 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

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Sep 12, 2024
@Dousir9 Dousir9 added the ci-cloud Build docker image for cloud test label Sep 15, 2024
Copy link
Contributor

Docker Image for PR

  • tag: pr-16448-4fb4473-1726412751

note: this image tag is only available for internal use,
please check the internal doc for more details.

@Dousir9 Dousir9 added ci-cloud Build docker image for cloud test and removed ci-cloud Build docker image for cloud test labels Sep 16, 2024
Copy link
Contributor

Docker Image for PR

  • tag: pr-16448-7ef2e23-1726490205

note: this image tag is only available for internal use,
please check the internal doc for more details.

@Dousir9 Dousir9 marked this pull request as ready for review September 18, 2024 07:06
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. A-query Area: databend query C-performance Category: Performance labels Sep 18, 2024
Copy link
Contributor

Docker Image for PR

  • tag: pr-16448-f7eb84b-1726645364

note: this image tag is only available for internal use,
please check the internal doc for more details.

Copy link
Contributor

Docker Image for PR

  • tag: pr-16448-f7eb84b-1726645433

note: this image tag is only available for internal use,
please check the internal doc for more details.

1 similar comment
Copy link
Contributor

Docker Image for PR

  • tag: pr-16448-f7eb84b-1726645433

note: this image tag is only available for internal use,
please check the internal doc for more details.

@BohuTANG BohuTANG removed the request for review from TCeason September 18, 2024 08:07
@Dousir9
Copy link
Member Author

Dousir9 commented Sep 18, 2024

Thanks to @zhang2014 for helping fix the pipeline.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 19, 2024
Copy link
Contributor

Docker Image for PR

  • tag: pr-16448-d40dab8-1726713037

note: this image tag is only available for internal use,
please check the internal doc for more details.

@zhang2014 zhang2014 added this pull request to the merge queue Sep 19, 2024
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Sep 19, 2024
@BohuTANG BohuTANG merged commit 2010fae into databendlabs:main Sep 19, 2024
79 of 80 checks passed
@forsaken628 forsaken628 mentioned this pull request Oct 9, 2024
4 tasks
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 ci-cloud Build docker image for cloud test lgtm This PR has been approved by a maintainer pr-feature this PR introduces a new feature to the codebase size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants