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

spill agg blocks using BlockInputStream #8040

Merged
merged 3 commits into from Aug 30, 2023

Conversation

windtalker
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #7738

Problem Summary:

What is changed and how it works?

spill aggregation data using Spiller::spillBlocksUsingBlockInputStream because it is more memory friendly.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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

None

Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
@ti-chi-bot ti-chi-bot bot added release-note-none size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 30, 2023
Copy link
Contributor

@SeaRise SeaRise left a comment

Choose a reason for hiding this comment

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

Others LGTM

}
agg_spill_context->getSpiller()->spillBlocks(std::move(blocks), 0);
auto block_input_stream = std::make_shared<AggHashTableToBlocksBlockInputStream<Method>>(*this, data_variants, method, max_temporary_block_size_rows, max_temporary_block_size_bytes);
agg_spill_context->getSpiller()->spillBlocksUsingBlockInputStream(block_input_stream, 0, is_cancelled);
agg_spill_context->finishOneSpill(thread_num);

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe

auto [max_temporary_block_size_rows, max_temporary_block_size_bytes] = block_input_stream->maxBlockRowAndBytes();

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Copy link
Contributor

@yibin87 yibin87 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 30, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SeaRise, yibin87

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

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 30, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-08-30 04:44:12.039647601 +0000 UTC m=+1902216.588663572: ☑️ agreed by SeaRise.
  • 2023-08-30 05:30:05.737399209 +0000 UTC m=+1904970.286415181: ☑️ agreed by yibin87.

@windtalker
Copy link
Contributor Author

/run-all-tests

@windtalker
Copy link
Contributor Author

/rebuild

Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
@windtalker
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot bot merged commit 15e13e0 into pingcap:master Aug 30, 2023
6 checks passed
@windtalker windtalker deleted the agg_spill_using_stream_way branch September 20, 2023 00:25
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants