Skip to content

[BugFix] Disable COUNT(*) fast path for duplicate key table with range distribution#69002

Open
srlch wants to merge 4 commits intoStarRocks:mainfrom
srlch:bugfix_count_range_table
Open

[BugFix] Disable COUNT(*) fast path for duplicate key table with range distribution#69002
srlch wants to merge 4 commits intoStarRocks:mainfrom
srlch:bugfix_count_range_table

Conversation

@srlch
Copy link
Contributor

@srlch srlch commented Feb 6, 2026

Why I'm doing:

For duplicate key table, SELECT COUNT(*) can be accelerated by tablet statistics or meta scan in BE/CN side. But for range distribution table, the row count statistics is not accurate, which may cause the query result to be incorrect.

What I've done:

  • Disable COUNT(*) fast path for duplicate key table with range distribution
  • Add a check in the rule to disable COUNT(*) fast path for duplicate key table with range distribution

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.1
    • 4.0
    • 3.5
    • 3.4

…e distribution

## Why I'm doing:
For duplicate key table, SELECT COUNT(*) can be accelerated by tablet statistics or meta scan in BE/CN side.
But for range distribution table, the row count statistics is not accurate, which may cause the query result
to be incorrect.

## What I've done:
- Disable COUNT(*) fast path for duplicate key table with range distribution
- Add a check in the rule to disable COUNT(*) fast path for duplicate key table with range distribution

Signed-off-by: srlch <linzichao@starrocks.com>
@srlch srlch requested a review from a team as a code owner February 6, 2026 08:43
@github-actions github-actions bot added the 4.1 label Feb 6, 2026
@mergify mergify bot assigned srlch Feb 6, 2026
@CelerData-Reviewer
Copy link

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4be908d7e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

srlch added 3 commits February 6, 2026 16:47
Signed-off-by: srlch <linzichao@starrocks.com>
Signed-off-by: srlch <linzichao@starrocks.com>
Signed-off-by: srlch <linzichao@starrocks.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants