开发者社区 问答 正文

如何主动删除键使用lazy free?

已解决

如何主动删除键使用lazy free?

展开
收起
游客lmkkns5ck6auu 2022-10-11 20:09:58 241 分享 版权
1 条回答
写回答
取消 提交回答
  • 推荐回答

    •UNLINK命令 127.0.0.1:7000> LLEN mylist (integer) 2000000 127.0.0.1:7000> UNLINK mylist (integer) 1 127.0.0.1:7000> SLOWLOG get 1) 1) (integer) 1 2) (integer) 1505465188 3) (integer) 30 4) 1) "UNLINK" 2) "mylist" 5) "127.0.0.1:17015" 6) "" •FLUSHALL/FLUSHDB ASYNC 127.0.0.1:7000> DBSIZE (integer) 1812295 127.0.0.1:7000> flushall //同步清理实例数据,180万个key耗时1020毫秒 OK (1.02s) 127.0.0.1:7000> DBSIZE (integer) 1812637 127.0.0.1:7000> flushall async //异步清理实例数据,180万个key耗时约9毫秒 OK 127.0.0.1:7000> SLOWLOG get 1) 1) (integer) 2996109 2) (integer) 1505465989 3) (integer) 9274 //指令运行耗时9.2毫秒 4) 1) "flushall" 2) "async" 5) "127.0.0.1:20110" 6) "" 以上内容摘自《阿里开发者手册-Redis专题》电子书,点击https://developer.aliyun.com/ebook/download/7770 可下载完整版

    2022-10-12 23:22:57
    赞同 展开评论