https://redis.io/docs/latest/commands/scan/#the-count-option

Basically with COUNT the user specifies the amount of work that should be done at every call in order to retrieve elements from the collection.

What does "work" mean?

I think there are two possible interpretations:

As a prerequisite, assume that keys matching the pattern far exceed 100 within Redis.

(1) https://stackoverflow.com/questions/60055548/is-there-any-recommended-value-of-count-for-scan-hscan-command-in-redis

The default value is 10. It means the command will bring back more or less 10 keys,

If COUNT is 100, you get approximately 100 keys. Redis continues searching until the number of result keys reaches around 100 items.

(2) https://docs.keydb.dev/blog/2020/08/10/blog-post/#scan-count

The COUNT is the number of keys to search through at a time per cursor iteration.

If COUNT is 100, you get 0~100 keys. Redis continues searching until the search area covers 100 items.

Which interpretation is correct?

Comment From: sundb

(1) stackoverflow.com/questions/60055548/is-there-any-recommended-value-of-count-for-scan-hscan-command-in-redis

The default value is 10. It means the command will bring back more or less 10 keys,

If COUNT is 100, you get approximately 100 keys. Redis continues searching until the number of result keys reaches around 100 items.

This is right, if COUNT is 100, you might get <100, 100, or >100

Comment From: SuperHiroki

Thank you!!!!