Skip to content

Refactor text index posting list codec into pluggable block framework - #113843

Merged
CurtizJ merged 2 commits into
ClickHouse:masterfrom
CurtizJ:postings-codec-refactoring
Aug 8, 2026
Merged

CurtizJ merged 2 commits into
ClickHouse:masterfrom
CurtizJ:postings-codec-refactoring

Conversation

@CurtizJ

@CurtizJ CurtizJ commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

Generalize the bitpacking-only segment codec into a pluggable per-block framework (IPostingListBlockCodec).

Cherry picked from commit b5e8bdd. Taken from PR #107408 to unlock future developments.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Version info

  • Merged into: 26.8.1.998 (included in 26.8 and later)

Generalize the bitpacking-only segment codec into a pluggable per-block
framework (IPostingListBlockCodec); no behavior change.

(cherry picked from commit b5e8bdd)
@clickhouse-gh

clickhouse-gh Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [065b143]

Summary: ❌

job_name test_name status info comment
Stress test (arm_msan) FAIL
Logical error: Bad cast from type A to B (STID: 3520-4525) FAIL cidb IGNORED

AI Review

Summary

This PR extracts the bitpacking-specific block encode/decode logic out of SegmentedPostingListCodec into IPostingListBlockCodec / createPostingListBlockCodec, and threads that abstraction through the lazy cursor's payload-size guard and block decode path. I did not find a correctness, compatibility, or lazy-read regression in the current head; the current Bitpacking wire format and caller-visible behavior look preserved.

Final Verdict
  • Status: ✅ Approve

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.60% 86.60% +0.00%
Functions 91.90% 91.80% -0.10%
Branches 78.80% 78.80% +0.00%

Changed lines: Changed C/C++ lines covered: 114/141 (80.85%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Aug 7, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 065b143d2 with master c8cea90a1 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 2999ffda7; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 690.38 MiB 687.39 MiB -2.99 MiB (-0.43%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Object file sizes

505 object files changed (+266.35 KiB total), 2 added.

Object file Master PR Δ
src/CMakeFiles/dbms.dir/Storages/MergeTree/PostingListBlockCodec.cpp.o new 183.24 KiB +183.24 KiB
src/CMakeFiles/dbms.dir/Processors/Formats/Impl/HiveTextRowOutputFormat.cpp.o new 148.12 KiB +148.12 KiB
src/CMakeFiles/dbms.dir/Storages/MergeTree/MergeTreeIndexTextPostingListCodec.cpp.o 212.64 KiB 69.73 KiB -142.90 KiB (-67.20%)
src/CMakeFiles/dbms.dir/Storages/MergeTree/MergeTreeIndexTextPostingListCursor.cpp.o 275.88 KiB 202.63 KiB -73.25 KiB (-26.55%)
src/CMakeFiles/dbms.dir/DataTypes/Serializations/SerializationMap.cpp.o 2.16 MiB 2.18 MiB +21.09 KiB (+0.96%)
src/CMakeFiles/dbms.dir/DataTypes/Serializations/SerializationArray.cpp.o 228.85 KiB 249.85 KiB +21.00 KiB (+9.18%)
src/CMakeFiles/dbms.dir/DataTypes/Serializations/SerializationTuple.cpp.o 271.66 KiB 292.33 KiB +20.66 KiB (+7.61%)

737 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

486 translation units recompiled, 614 s compile time in total, 17 of them have a recent master baseline.

Translation units without a recent master baseline:

  • contrib/llvm-project-cmake/__/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp: 11.0 s
  • contrib/vectorscan-cmake/__/vectorscan/src/nfagraph/ng_violet.cpp: 6.9 s
  • contrib/llvm-project-cmake/__/llvm-project/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp: 6.1 s
  • contrib/wasmedge-cmake/__/wasmedge/lib/executor/instantiate/component/component.cpp: 6.1 s
  • contrib/ai-sdk-cpp-cmake/__/ai-sdk-cpp/src/providers/openai/openai_factory.cpp: 5.9 s
  • contrib/llvm-project-cmake/__/llvm-project/llvm/utils/TableGen/GlobalISelEmitter.cpp: 5.8 s
  • contrib/s2geometry-cmake/__/s2geometry/src/s2/s2builder.cc: 5.7 s
  • contrib/wasmedge-cmake/__/wasmedge/lib/executor/engine/threadInstr.cpp: 5.7 s
  • contrib/wasmedge-cmake/__/wasmedge/lib/executor/instantiate/table.cpp: 5.5 s
  • contrib/vectorscan-cmake/__/vectorscan/src/rose/rose_build_program.cpp: 5.3 s

Job report

@CurtizJ
CurtizJ force-pushed the postings-codec-refactoring branch from 174daeb to 065b143 Compare August 8, 2026 11:56
@CurtizJ CurtizJ self-assigned this Aug 8, 2026
@CurtizJ
CurtizJ added this pull request to the merge queue Aug 8, 2026
Merged via the queue into ClickHouse:master with commit 7624c95 Aug 8, 2026
179 of 181 checks passed
@CurtizJ
CurtizJ deleted the postings-codec-refactoring branch August 8, 2026 18:31
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants