38

I get values with "KEYS p_*" command in redis.

But with "KEYS p_*" , if the redis has millions of keys,I will get too many values and bad performence.

So can I just get 100 values with "KEYS p_*" command?

1 Answer 1

66

SCAN is recommended for production, so you can use something like:

SCAN 0 COUNT 100 MATCH p_*

and keep getting the next page
for more details see the SCAN command:
http://redis.io/commands/scan

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.