1

Method KEYS (on Rediska named getKeysByPattern()) is very slow. 200 iterations on 10k db takes 20-25 seconds!

For example, keys named like foo:time:*:y:*:m:*:d:*:h:*:i:*:bar_name:*:item_id:*:category_id:*

Its a normal behaviour of redis or rediska php client?

1 Answers1

2

rediska getKeysByPattern uses the redis KEYS command

Here is a bit of text from Redis docs (http://redis.io/commands/keys) regarding that 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 sets.

Tommaso Barbugli
  • 11,781
  • 2
  • 42
  • 41