Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of KEYS command #307

Open
ipmb opened this issue Apr 22, 2022 · 1 comment
Open

Remove use of KEYS command #307

ipmb opened this issue Apr 22, 2022 · 1 comment

Comments

@ipmb
Copy link
Contributor

ipmb commented Apr 22, 2022

The keys command is used here to find a set of keys to delete

local keys = redis.call('keys', ARGV[1])

Redis docs have a strong warning about the keys command:

Warning: consider KEYS as a command that should only be used in production environments with extreme care. It may ruin performance when it is executed against large databases. This command is intended for debugging and special operations, such as changing your keyspace layout. Don't use KEYS in your regular application code. If you're looking for a way to find keys in a subset of your keyspace, consider using SCAN or sets.

scan looks like it would be a straightforward substitution.

Even when there aren't lots of this is a concern because it is listed in the @dangerous ACL command category which may be blocked on some installations.

@carltongibson
Copy link
Member

Sounds right. 👍

@carltongibson carltongibson pinned this issue Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants