Skip to content

[NEW] Scan with a specified probability #1938

Open
@guozhihao-224

Description

@guozhihao-224

The problem/use-case that the feature addresses

In scenarios like data migration validation or hotkey analysis, users need to efficiently sample a subset of keys without full-database scanning. Current approaches require either:

  • Pulling all keys via SCAN and filtering client-side (high network overhead), It has a large impact on the original node, and the full scan takes a long time
  • Running full RDB checks (resource-intensive for large datasets), the operation needs to be performed on the machine of the instance

Description of the feature

we can enhan the functionality of the scan command:

SCAN cursor [MATCH pattern] [PROBABILITY float] [COUNT count]
  • PROBABILITY: 0.0-1.0 (probability threshold)

Metadata

Metadata

Assignees

No one assigned

    Labels

    client-changes-neededClient changes may be required for this feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions