Mryange opened a new pull request, #70689: URL: https://github.com/apache/doris/pull/70689
### Background ColumnReader keeps protobuf descriptors for ordinal, segment/page zone map and Bloom indexes. Scalar cache misses and VARIANT leaf lookups currently copy descriptors out of temporary ColumnMetaPB objects. ### What problem does this PR solve? Issue Number: None Related PR: None PR Type: Performance Problem Summary: Avoid copying index descriptors that are already exclusively owned by temporary column metadata. Add an explicit consuming factory for scalar readers and ownership-taking index-reader constructors, while retaining the existing const-reference APIs for borrowed metadata and complex types. ### Details - **Why it was slow:** Creating a reader copied protobuf descriptors immediately before their temporary source metadata was destroyed. - **Optimization:** Transfer ordinal, segment zone map, page zone map and Bloom descriptors through protobuf release APIs into their existing owners. Apply this to scalar cache misses and temporary VARIANT leaf metadata. - **Results:** Descriptor copies are removed on the consuming scalar path. End-to-end performance has not been measured. - **Applicability and cost:** Borrowed/shared metadata and complex-type creation retain copying. No new cache, configuration or storage format; optional-field default semantics are preserved. ### Testing - ASAN `BUILD_TYPE=ASAN ./build.sh --be -j48`: passed. - Repository clang-format 16 formatting and check scripts, scoped to the seven changed files: passed. - `build-support/check-build-hygiene.sh` and `git diff --check`: passed. - `build-support/run-clang-tidy.sh --build-dir be/build_ASAN --base upstream/master`: passed for all seven changed files, using the toolchain resource directory explicitly. No UTs were added or run. Runtime query validation and performance measurements were not performed. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Partially verified: build/static-check evidence below; runtime validation and performance measurements not performed. ### AI Disclosure - Tool: OpenAI Codex - Generated: Implementation and PR description. - Human review: The author reviewed the local implementation before requesting submission. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
