Skip to content

branch-4.1: [opt](schema) Optimize tables schema scan status #64933 - #65631

Open
0AyanamiRei wants to merge 4 commits into
apache:branch-4.1from
0AyanamiRei:pick-64933-branch-4.1
Open

branch-4.1: [opt](schema) Optimize tables schema scan status #64933#65631
0AyanamiRei wants to merge 4 commits into
apache:branch-4.1from
0AyanamiRei:pick-64933-branch-4.1

Conversation

@0AyanamiRei

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: #64933

Problem Summary: Backport the information_schema.tables column-pruning and single-pass table-status statistics optimization from #64933 to branch-4.1.

Source merge commit: 058dfd3794aca46617766173ced5ac5574efff94.

Conflict resolution

  • The only content conflict was the import block of FrontendServiceImplTest.
  • Preserved branch-4.1's JMockit @Mocked ExecuteEnv dependency and added the Guava Sets import required by the new mixed-case required-column test.
  • Kept imports in the order expected by branch-4.1 Checkstyle.
  • All production, Thrift, FE unit-test, and regression-test hunks from the source PR are otherwise retained unchanged.

The resulting backport retains the source behavior: lightweight projections skip tablet-derived status work, while full status queries compute row/data/index statistics in one tablet traversal.

Release note

None

Check List (For Author)

  • Test: No need to test (one-time Agent conflict-resolution workflow; build and test execution were intentionally excluded)
    • build-support/clang-format.sh
    • build-support/check-format.sh
    • git diff HEAD^ HEAD --check
  • Behavior changed: No
  • Does this need documentation: No

### What problem does this PR solve?

Issue Number: None

Related PR: apache#64933

Problem Summary: Backport the information_schema.tables column-pruning and
single-pass table-status statistics optimization to branch-4.1. Resolve the
test import conflict by retaining branch-4.1's JMockit ExecuteEnv setup while
adding the Guava Sets dependency used by the new status-pruning tests. All
production and test hunks from the source PR are preserved.

### Release note

None

### Check List (For Author)

- Test: No need to test (this one-time conflict-resolution workflow excludes
  builds and test execution; C++ format checks and git diff --check passed)
- Behavior changed: No
- Does this need documentation: No

(cherry picked from commit 058dfd3)
@0AyanamiRei
0AyanamiRei requested a review from yiguolei as a code owner July 15, 2026 07:06
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@0AyanamiRei

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.35% (1888/2441)
Line Coverage 64.38% (33891/52639)
Region Coverage 64.91% (17485/26936)
Branch Coverage 54.08% (9367/17322)

@0AyanamiRei

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.35% (1888/2441)
Line Coverage 64.38% (33888/52636)
Region Coverage 64.90% (17480/26934)
Branch Coverage 54.06% (9363/17320)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 76.74% (66/86) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 56.41% (22624/40105)
Line Coverage 40.17% (221223/550702)
Region Coverage 36.49% (174499/478212)
Branch Coverage 37.57% (77883/207298)

@0AyanamiRei

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.58% (1900/2449)
Line Coverage 64.44% (33990/52745)
Region Coverage 64.96% (17527/26980)
Branch Coverage 54.10% (9389/17356)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.07% (23301/40830)
Line Coverage 41.07% (230949/562297)
Region Coverage 37.39% (183019/489449)
Branch Coverage 38.44% (82156/213724)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (3/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.11% (29149/39869)
Line Coverage 56.82% (317863/559398)
Region Coverage 53.92% (265537/492451)
Branch Coverage 54.75% (117142/213961)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 4.53% (44/972) 🎉
Increment coverage report
Complete coverage report

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jul 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@0AyanamiRei

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 58.01% (24292/41876)
Line Coverage 42.11% (242418/575653)
Region Coverage 38.20% (191478/501264)
Branch Coverage 39.49% (87076/220523)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (3/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.47% (30051/40903)
Line Coverage 57.32% (328183/572530)
Region Coverage 54.23% (273410/504179)
Branch Coverage 55.22% (121846/220654)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 86.05% (74/86) 🎉
Increment coverage report
Complete coverage report

@shuke987

shuke987 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. I did not find a blocking correctness issue in the current head, so my opinion is approval/no changes requested.

Critical checkpoint conclusions:

  • Goal and scope: The backport is focused on information_schema.tables column pruning and single-pass table-status statistics. Required scan slots are propagated through the BE/Thrift/FE path, while OLAP status values are collected in one tablet traversal.
  • Correctness: Projection and predicate slots are retained in the propagated set; optional status fields map to the fields the BE reads. The prior CHECK_TIME aliasing concern is fixed by setting last_check_time when CHECK_TIME is requested and is covered by a direct test.
  • Statistics semantics: Row counts, NORMAL-replica filtering for average size, all-replica local/remote segment and inverted-index totals, zero/unknown handling, and table read locking preserve the prior behavior for local and cloud tablets. Other table kinds retain their existing getters through the default aggregate wrapper.
  • Compatibility and lifecycle: required_columns is an optional new Thrift field. Unset callers keep the full legacy response, and old/new FE-BE combinations safely ignore the unknown optional field or fall back to full status. Required columns are finalized during operator prepare before scanner-local reads; no new shared mutable lifecycle or lock-order issue was found.
  • Parallel and special paths: Full-status callers, empty required sets, mixed-case column names, views/external tables, local/cloud tablets, abnormal replicas, predicate-only slots, and CHECK_TIME were traced. No distinct issue survived.
  • Tests and validation: The changed FE tests cover pruning, empty/mixed-case sets, CHECK_TIME, combined status collection, and replica filtering; the regression suite covers planner-path tuple pruning. The review prompt forbids local builds/tests, so none were run here. Live checks at this head pass compile, FE UT, BE UT, P0, cloud/vault, external regression, and coverage. The lone non-concurrent failure is an unrelated routine-load cleanup failure caused by a still-completing committed transaction; it does not exercise a changed schema-status path.
  • User focus: No additional review focus was provided; the entire PR was reviewed.
  • Convergence: Two normal full-coverage reviewers and one separate risk-focused reviewer all returned NO_NEW_VALUABLE_FINDINGS in round 1 for the same frozen head, empty existing-thread set, and empty inline comment set. The main-agent final sweep found no unresolved candidate.

Review-environment note: the repository code-review skill referenced by the bundle was absent from both the checkout and HEAD, and no changed-path ancestor AGENTS.md files apply. I followed the complete bundle workflow and preserved this limitation explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants