Skip to content

add joined_rows to tiflash hash table stats - #433

Merged
windtalker merged 1 commit into
pingcap:masterfrom
ChangRui-Ryan:changrui_ru
Oct 13, 2026
Merged

windtalker merged 1 commit into
pingcap:masterfrom
ChangRui-Ryan:changrui_ru

Conversation

@ChangRui-Ryan

@ChangRui-Ryan ChangRui-Ryan commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

What is changed and how it works?

Proposal: xxx

What's Changed:

How it Works:

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Summary by CodeRabbit

  • New Features
    • Hash-join statistics now include the number of row pairs matched on join keys before other conditions are applied. This metric may be unavailable for hash aggregation and may count only the first match in some semi/anti joins.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c4c44497-1e83-4336-bb88-c2b2c018d991
📥 Commits

Reviewing files that changed from the base of the PR and between 59b6783 and c85a02a.

⛔ Files ignored due to path filters (2)
  • go-tipb/executor.pb.go is excluded by !**/*.pb.go
  • scripts/proto.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • proto/executor.proto

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The TiFlashHashTableStats message adds the optional joined_rows field, with documentation defining its count and reporting scope.

Changes: Hash Join Statistics

Layer / File(s) Summary
Add joined-row statistics field
proto/executor.proto
Adds optional field joined_rows with field number 4. Its comment defines the count, notes possible first-match counting for some semi/anti joins, and states that hash aggregation does not report it.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: windtalker

Merge Risk: ⚪ Minimal · up to c85a0

The optional statistics field preserves existing metrics, and absent values read as zero. No concrete compatibility or behavior regression is established, so the change appears mergeable after normal checks.

### Architecture Summary

Architecture risk: 🔵 Low · up to c85a0

The change affects 1 system.

Changed systems: proto

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — proto (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in proto/executor.proto: TiFlashHashTableStats adds optional joined_rows field 4. Its comments define the count as equi-key-matched probe/build row pairs before other conditions, note the first-match behavior possible for semi/anti joins without other conditions, and limit reporting to hash joins rather than hash aggregation.
Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Description check Warning The description only repeats the repository template. It provides no problem summary, issue information, change details, implementation details, or related-change decisions. Complete the required sections. Describe the problem, explain the addition of joined_rows and its semantics, provide implementation details, and state whether related documentation updates or release-branch cherry-picking are required.
Passed Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the main change: adding joined_rows to TiFlash hash table statistics. It is concise and specific.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Buf (1.73.0)

Lint configuration: default MINIMAL rules with the repository root as the protobuf import root; no repository Buf configuration was found. These results do not establish the project's lint policy or build configuration. For unresolved imports or symbols, check the project's declared import roots and dependencies before concluding that its build fails.

proto/executor.proto

fatal: unable to access 'https://github.com/pingcap/tipb.git/': Failed to connect to github.com:443 over proxy 127.0.0.1 after 0 ms: Could not connect to server
fatal: could not fetch b2e6024fd8ad483950bae478c3371425c37314ad from promisor remote

CODERABBIT_BUF_COMPATIBILITY_PHASE=materialize-base

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit reads the row count clear,
New joined pairs are noted here.
Before conditions shape the view,
The field records what keys match true.
Then hops away with stats in tow.

Comment @coderabbitai help to get the list of available commands.

@windtalker windtalker 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.

lgtm

@windtalker
windtalker merged commit c242285 into pingcap:master Oct 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants