Support `BatchScanRegions` which loads non-continuous regions in one RPC
you06 opened this issue · comments
you06 commented
Development Task
Sometimes, the client need to locate non-continuous key ranges. Current PD has no good solution for this requirement.
There are 2 workaround:
- Use
GetRegion
to load region one by one, check if the ranges are drained eachtime. - Use
ScanRegion
to load(ranges[0].start, ranges[len(ranges)-1].end)
, which can cause unexpected traffics (imagine the ranges[0] is the first row and ranges[len(ranges)-1] is the last row of a large table).
Thus a interface BatchScanRegions
is required.
It returns multi regions like ScanRegion
, but accept a key range slice parameters. The returned regions are guaranteed to cover the given ranges if limitation is not reached.