[Redis] Several advanced commands

1.keys: Full traversal of keys

The two methods of keys & scan are used for fuzzy query of key

It is used to list all the keys that meet the specific regular string rules. When the amount of redis data is relatively large, the performance is relatively poor, so avoid using

keys *xxx // abcxxx
keys xxx* // xxxabc
keys xx*xx //xxabcxx

2.scan: Progressive traversal of keys

scan (cursor) match (xxx *) count (limit)

The scan parameter provides three parameters, the first is the cursor integer value, the second is the regular mode of the key, and the third is the number of keys traversed at a time, not the number of results that meet the conditions. In the first traversal, the cursor value is 0, and then the first integer value in the returned result is used as the cursor for the next traversal. The traversal continues until the returned cursor value is 0.

Insert picture description here

3.Info: View redis service operation information

Divided into 9 blocks, each block has a lot of parameters, these 9 blocks are:

  • Server server operating environment parameters
  • Clients client related information
  • Memory server running memory statistics
  • Persistence persistent information
  • Stats general statistics
  • Replication master-slave replication related information
  • CPU CPU usage
  • Cluster cluster information
  • KeySpace key-value pair statistics information

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_43935927/article/details/114027823