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

executor: add DataInDiskByChunks to spill and restore data in chunks #48160

Merged
merged 33 commits into from
Nov 30, 2023

Conversation

xzhangxian1008
Copy link
Contributor

@xzhangxian1008 xzhangxian1008 commented Nov 1, 2023

What problem does this PR solve?

Issue Number: ref #47733

Problem Summary:

What is changed and how it works?

Benchmark 1
Dataset: tpch10
tidb_mem_quota_query: 600Mib
sql: select l_orderkey from tpch10.lineitem group by l_orderkey having sum(l_quantity) > 300;
Results:

Time
In rows 125.51s
In chunks 74.8s
67.8%

Benchmark2
Chunk num: 100
Row num in a chunk: 2000
Schema: 5 columns, with types: string, int64, string, int64, json
Results:

Spill one chunk Restore one chunk
In rows 73.74ms 160.87ms
In chunks 50.77ms 29.74ms
45.2% 440.9%

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-tests-checked release-note-none size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked labels Nov 1, 2023
Copy link

tiprow bot commented Nov 1, 2023

Hi @xzhangxian1008. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@xzhangxian1008
Copy link
Contributor Author

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 1, 2023
@xzhangxian1008 xzhangxian1008 mentioned this pull request Nov 1, 2023
13 tasks
@xzhangxian1008
Copy link
Contributor Author

/cc @guo-shaoge

@ti-chi-bot ti-chi-bot bot requested a review from guo-shaoge November 1, 2023 03:32
Copy link

codecov bot commented Nov 1, 2023

Codecov Report

Merging #48160 (52248d0) into master (db8f109) will increase coverage by 1.2307%.
Report is 93 commits behind head on master.
The diff coverage is 82.1167%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #48160        +/-   ##
================================================
+ Coverage   71.1246%   72.3553%   +1.2307%     
================================================
  Files          1365       1394        +29     
  Lines        404414     426944     +22530     
================================================
+ Hits         287638     308917     +21279     
- Misses        96830      98723      +1893     
+ Partials      19946      19304       -642     
Flag Coverage Δ
integration 43.6678% <18.2481%> (?)
unit 71.1034% <87.2000%> (-0.0212%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9663% <ø> (ø)
parser ∅ <ø> (∅)
br 47.7077% <ø> (-5.3765%) ⬇️

@xzhangxian1008
Copy link
Contributor Author

/cc @SeaRise

@ti-chi-bot ti-chi-bot bot requested a review from SeaRise November 20, 2023 07:02
pkg/util/chunk/chunk_in_disk.go Outdated Show resolved Hide resolved
pkg/util/chunk/chunk_in_disk.go Outdated Show resolved Hide resolved
@xzhangxian1008
Copy link
Contributor Author

How about adding a performance test report in the PR description? Others LGTM

okk, I will make a performane report.

pkg/util/chunk/chunk_in_disk.go Show resolved Hide resolved
pkg/util/chunk/chunk_in_disk.go Outdated Show resolved Hide resolved
pkg/util/chunk/chunk_in_disk.go Outdated Show resolved Hide resolved
pkg/util/chunk/chunk_in_disk.go Outdated Show resolved Hide resolved
pkg/util/chunk/chunk_in_disk.go Outdated Show resolved Hide resolved
pkg/util/chunk/chunk_in_disk.go Outdated Show resolved Hide resolved
pkg/util/chunk/chunk_in_disk.go Show resolved Hide resolved
pkg/util/chunk/chunk_in_disk.go Show resolved Hide resolved
@guo-shaoge
Copy link
Collaborator

other LGTM

Copy link

ti-chi-bot bot commented Nov 30, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guo-shaoge, SeaRise

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

ti-chi-bot bot commented Nov 30, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-28 08:52:01.905563679 +0000 UTC m=+912750.570789859: ☑️ agreed by SeaRise.
  • 2023-11-30 03:36:45.242990251 +0000 UTC m=+1066633.908216446: ☑️ agreed by guo-shaoge.

@xzhangxian1008
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 30, 2023
@xzhangxian1008
Copy link
Contributor Author

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 30, 2023
@xzhangxian1008
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 30, 2023
@xzhangxian1008
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Nov 30, 2023

@xzhangxian1008: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@xzhangxian1008
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Nov 30, 2023

@xzhangxian1008: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot merged commit d1e87da into pingcap:master Nov 30, 2023
15 checks passed
@xzhangxian1008 xzhangxian1008 deleted the restore-by-chunk branch November 30, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants