In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
When we need to traverse all the key of Redis or the key of a specified mode, the first thing that comes to mind is the KEYS command, such as: keys *
It is equivalent to select * in a relational database, so using this command in a large Redis database in a production environment can cause performance problems.
Since the Redis2.8 version, officials have provided us with a better command SCAN for traversing KEY.
The syntax is:
SCAN cursor [MATCH pattern] [COUNT count]
For example:
127.0.0.1 scan 6379 > 0 match * 192.168 *
1) "105"
2) 1) "192.168.0.220:6379:CommandCountByMinute"
2) "192.168.0.121:6379:memory"
3) "192.168.0.213:6379:CommandCount:1528190604"
4) "192.168.0.221:6379:KeyCount:1528190601"
5) "192.168.0.226:6379:KeyCount:1528190334"
6) "192.168.0.129:6379:CommandCount:1528121363"
7) "192.168.0.129:6379:KeyCount:1528121366"
Each element returned by the SCAN command is a database key, which has little impact on database performance, so it is recommended for use in production environments.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.