Working with large keyspaces
Use specific SCAN
filter to reduce loaded amount of keys
By default RESP.app uses *
(wildcard glob-style pattern) in SCAN
command to load all keys from the selected database. It’s simple and user-friendly for cases when you have only a couple of thousands keys. But for production redis-servers with millions of keys it leads to a huge amount of time needed to load keys in RESP.app.
However, while working with production redis-servers that contain millions of keys users have to wait for a long time till all keys are loaded.
Consider using more specific filters for SCAN
in order to speed up keys loading and reduce memory footprint
- Right click on database and click on Filter button
- Enter glob-style pattern and press apply button
More details about SCAN
filter syntax you can find in Redis documentation https://redis.io/commands/scan#the-match-option
Default SCAN
filter can be changed in connection settings on “Advanced Settings” tab:
Use namespaced keys
Colon sign :
is a commonly used convention when naming Redis keys. For example you can use following schema to store information about users:
user:1000
Following this schema allows you to simplify removal of obsolete keys and performing other operations with keys in Redis.
Using namespaced keys is also important for loading huge keyspaces in RESP.app. It renders namespaces on demand (since 2020.2+) and this approach allows to visualise millions of keys with small memory footprint.
Default namespace separator can be changed in connection settings on “Advanced Settings” tab.
More tips about Redis keys naming you can find in this tutorial https://redis.io/topics/data-types-intro#redis-keys