Repository navigation
Conversation
…egression PR #109105 replaced assumeMutable with IColumn::mutate in serialization code. In ISerialization::deserializeBinaryBulkWithMultipleStreams this caused a severe performance regression (3-4x slower) because columns are intentionally shared via the substreams cache between multiple readers (e.g. reading both a full Tuple column and its named subcolumns). IColumn::mutate clones the column when use_count > 1, defeating the cache and causing unnecessary copies on every readRows call. MergeTree readers return a set of constant columns that are not mutated after reading, so sharing subcolumns via the same ColumnPtr is safe and assumeMutable is the correct approach in the base deserialization path. Keep IColumn::mutate in the other four call sites where the column is not shared via the cache: - ISerialization::insertDataFromCachedColumn - SerializationArrayOffsets (rows_offset > 0 path, cache stores cut() copy) - SerializationStringSize (rows_offset > 0 path, cache stores cut() copy) - SerializationVariant discriminators (rows_offset > 0 path, cache stores cut() copy) Also adds a performance test for Tuple subcolumn deserialization covering both wide parts (with alternating granule skipping via minmax index) and compact parts (with nested Tuple to exercise substream cache sharing). Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
|
Workflow [PR], commit [f3f1444] Summary: ✅
AI ReviewSummaryThis PR partially reverts the Missing context / blind spots
Findings
|
Contributor
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 12/24 (50.00%) · Uncovered code |
Member
Author
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.

Revert part of the changes in serializations from #109105, add performance test that clearly shows the performance degradation after these changes.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...