Skip to content

Fast schema partition fetch for single device query#17493

Open
CRZbulabula wants to merge 1 commit intomasterfrom
optimize-cluster-partition-fetcher
Open

Fast schema partition fetch for single device query#17493
CRZbulabula wants to merge 1 commit intomasterfrom
optimize-cluster-partition-fetcher

Conversation

@CRZbulabula
Copy link
Copy Markdown
Contributor

To improve the efficiency of single device query.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Optimizes schema partition response parsing in the DataNode query analyzer to reduce overhead for common “single slot” (often single-device) schema partition fetches, improving single-device query efficiency.

Changes:

  • Adds a fast path in parseSchemaPartitionTableResp when only one series partition slot is returned for a database.
  • Replaces stream-based distinct collection with a HashSet-based distinct group id collection for the general case.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Map<TSeriesPartitionSlot, TConsensusGroupId> seriesPartitionTable = entry1.getValue();

if (seriesPartitionTable.size() == 1) {
// Fast collection in case of query for single device
@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.84%. Comparing base (3adba33) to head (f9a18ea).

Files with missing lines Patch % Lines
...ryengine/plan/analyze/ClusterPartitionFetcher.java 0.00% 15 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17493      +/-   ##
============================================
- Coverage     39.84%   39.84%   -0.01%     
  Complexity      312      312              
============================================
  Files          5136     5136              
  Lines        347013   347020       +7     
  Branches      44225    44226       +1     
============================================
  Hits         138257   138257              
- Misses       208756   208763       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants