Repository navigation
Conversation
Member
|
Let's fill the changelog entry and fix the style so that the tests can run. |
Member
|
I like the idea; let's see how it will go! |
jorisgio
force-pushed
the
vertical_skip_final
branch
from
March 28, 2023 10:28
fcddc46 to
c5f4de5
Compare
jorisgio
force-pushed
the
vertical_skip_final
branch
from
March 28, 2023 10:38
c5f4de5 to
f4b02aa
Compare
jorisgio
force-pushed
the
vertical_skip_final
branch
from
March 29, 2023 15:11
bf189c6 to
0e4ce00
Compare
…erge sort level for non overlapping chunks
jorisgio
force-pushed
the
vertical_skip_final
branch
from
March 30, 2023 07:51
0e4ce00 to
2d2b645
Compare
Contributor
Author
|
fwiw i'm not super convinced by this. It works on benchmarks with many columns/some string columns, can be as better as twice faster when just fetching data with FINAL. It is a bit slower with low columns counts / small numbers columns. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add a skip_replacing_final merge algorithm for ReplacingMergeTree to improving cache efficiency by merging columns by columns instead of row by row.
Description
This PR is a draft, i'm not very proficient in C++ or clickhouse and there is a major bug somewhere, Trying to get feedback on the idea and if the optimisation is worth it.
Currently, FINAL for ReplacingMergeTree uses an horizontal implementation. If you run FINAL with a ~5/10 columns, memcpy and moving data to MergedData chunk shows up in profile as ~40% of cpu. For a long time, i thought it was hitting memory bandwidth limitation, but in fact, it seems to be more a access latency/cache bottleneck.
To work around this, this is an attempt at implementing merging more vertically and with less copy, while dropping the benefit that the output stream remains sorted by PK.
There are two optimisations :
On tests, it seems to make no impact on single columns/small final up to twice faster when doing final on table with many columns.