EKEYS

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

List keys

Usage: ekeys *
Output is data_type:key_name. Example) string:key1
📍Output (query) count limit: limited by redis.conf ll_max 10000.
📍Why the limit: if there are very many keys (e.g. 10 million or more) and there is no limit, other commands cannot run while this command runs, which can be a problem on production servers.
The default ll_max is 10000. You can change it at runtime with CONFIG SET if needed.

Example

Command>ekeys     ℹ️ If you do not specify 'key_pattern', all keys are listed.
Result>1) "string:keyB_000538223312"
2) "string:keyB_000652109500"
.......................
804) "hash:myhash76"
Command>ekeys *
Result>1) "string:keyB_000538223312"
2) "string:keyB_000652109500"
.......................
804) "hash:myhash76"
Command>ekeys keyA*     ℹ️ List keys starting with keyA
Result>1) "string:keyA_000375248904"
2) "string:keyA_000082855540"
.......................
200) "string:keyA_000962842702"
Command>ekeys * string     ℹ️ List string data type keys
Result>1) "string:keyB_000538223312"
2) "string:keyB_000652109500"
.......................
403) "string:keyA_000962842702"    
ℹ️ From ent810, data is stored separately by data type, so specifying a data type is recommended.
Command>ekeys * string count 10     ℹ️ Specify the output (query) count
Result>1) "string:keyB_000538223312"
2) "string:keyB_000652109500"
.......................
10) "string:keyB_000015333864"


Syntax

EKEYS [key_pattern] [data_type] [COUNT count]

  • Available since Ent 8.1.0.
  • Time complexity is O(N).

<< ETYPE EKEYS ELS >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.