Repository navigation
Avoid building unused full-column serializations in MergeTree readers - #111020
alexey-milovidov merged 4 commits into
Conversation
|
Workflow [PR], commit [ea31b9b] Summary: ✅
AI ReviewSummaryThis PR narrows Missing context / blind spots
Final Verdict✅ No findings. LLVM Coverage ReportMeasured on commit ea31b9b.
Changed lines: Changed C/C++ lines covered: 7/7 (100.00%) · Uncovered code |
|
📊 Cloud Performance Report ✅ AI verdict: no significant changes detected. K_source=6 K_base=30 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 14 s compile time in total, 7 of them have a recent master baseline. |
Reuse the same parent serialization, deserialization state, and cached column for full-column and subcolumn requests without substream marks. Copy only the current granule when the cached full column spans earlier granules. Cover both request orders and block boundaries, and add a mixed full-column/subcolumn performance query. ClickHouse#110957 (comment) Related: ClickHouse#111020 ClickHouse#110957
Related: #110957
IMergeTreeReadercurrently constructs and stores a full-column serialization whenever a subcolumn is requested. However,serializations_of_full_columnsis only consumed byMergeTreeReaderCompactwhen reading compact parts that do not have substream marks.This means wide parts and compact parts with substream marks construct full-column serializations that are never used. This is particularly expensive for
JSON, where constructingSerializationJSONalso builds the JSON extraction tree.Restrict initialization to the only reader configuration that consumes it: compact parts without substream marks. This avoids unnecessary CPU and memory allocation for all other subcolumn reads without introducing another cache or changing serialization lifetime.
The change passed the focused
03732_json_duplicated_path_in_dynamic_paths_and_shared_data_compact_part_bugstateless test in both parallel and sequential jobs. It was also validated with Debug and production ThinLTO builds. The PostHog JSON microbenchmark retained the previous optimized performance within run-to-run noise.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Avoid unnecessary construction of full-column serializations when reading subcolumns from wide parts or compact parts with substream marks.
Documentation entry
Workflow [PR]
Sync PR [sync-upstream/pr/111020]
Version info
26.9.1.1343(included in26.9and later)