-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Parallelize query processing right after reading FROM ... #48727
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1748853
Parallelize query processing right after reading FROM ...
devcrafter ac54033
Let's see blast radius w/o parallelization after numbers()
devcrafter ba1adeb
Fix fast tests
devcrafter 5ed85d9
Fix 00109_shard_totals_after_having.sql
devcrafter bb60f10
Fix 02231_buffer_aggregate_states_leak.sql
devcrafter fcd2eae
Disable 'Dictionary' storage due to count() can return incorrect result
devcrafter eacbd2b
Fix test_storage_mysql/test_settings_connection_wait_timeout
devcrafter 39df2bd
Automatic style fix
robot-clickhouse a01efbd
Fix flaky check
devcrafter fa63460
Merge remote-tracking branch 'origin/master' into parallel-processing…
devcrafter 780e4f9
Fix flaky check: 00109_shard_totals_after_having.sql
devcrafter 7c84dc4
Better way to define for which storage output is parallelized
devcrafter 4dfad9e
Try to fix flaky intergration test
devcrafter 9e92c26
Fix test_storage_mysql/test.py::test_settings_connection_wait_timeout
devcrafter 60dbb7b
Merge remote-tracking branch 'origin/master' into parallel-processing…
devcrafter 6c03b2e
Automatic style fix
robot-clickhouse 8603807
Use generic way to parallelize output for file()
devcrafter cdd9aef
Merge remote-tracking branch 'origin/master' into parallel-processing…
devcrafter 908ad29
Do not parallelize output for zeroes()
devcrafter 2455334
Merge remote-tracking branch 'origin/master' into parallel-processing…
devcrafter d5eb65b
Remove redundant narrowPipe()
devcrafter 8a92eb0
Update src/Storages/IStorage.h
alexey-milovidov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InterpreterSelectQuery?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok to do it here with the following considerations ...
num_streamsis provided byInterpreterSelectQueryas a recommendation, i.e. how many threads are available for data processing. The reading step has the following choices:(a) it knows the amount of data it can read, and it's not much data, so it creates only the necessary number of data streams based on parameters passed to
IStorage::read()i.e.max_block_size/storage_limits. In this case, we don't want to adjust the number of streams andparallelizeOutputAfterReading()can returnfalse(b) it's either an unknown amount of data or known amount of data (but enough to utilize all available threads) -> in both cases output is parallelized by
num_streamsThe generic thing about this change affects only storage which will use default plan step to read from storage –
ReadFromStorageStep. Sophisticated engines use specialized steps to read from its storage, likeReadFromMergeTreeinMergeTreecase.StorageFromMergeTreeDataPartis not affected since it uses theReadFromMergeTreestep, which overridesread()method whereresize()is added.