-
Notifications
You must be signed in to change notification settings - Fork 755
Closed
Labels
affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.type/feature-requestCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Description
Feature Request
Describe your feature request related problem
TiDB need to get region count between startKey and endKey from /pd/api/v1/stats/region to calculate TiFlash replica progress. GetRegionStatus will scan regions in BTree so it will have heavy cost if there are many regions.
In fact, TiDB only need region count, if /pd/api/v1/stats/region can add parameter to only get region count, the cost of /pd/api/v1/stats/region will reduce from O(N) to O(logN).
1 million regions, call /pd/api/v1/stats/region per 2 seconds, flame graph on PD:

Describe the feature you'd like
Add a parameter in /pd/api/v1/stats/region to get only region count.
Describe alternatives you've considered
Teachability, Documentation, Adoption, Migration Strategy
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.type/feature-requestCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.