取消链接
Syntax
UNLINK key [key ...]
- Available since:
- 4.0.0
- Time complexity:
- O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of.
- ACL categories:
-
@keyspace
,@write
,@fast
,
这个命令与DEL
非常相似:它删除指定的键。
就像DEL
一样,如果键不存在,它会被忽略。然而,该命令
在不同的线程中执行实际的内存回收,因此它不会
阻塞,而DEL
会阻塞。这就是命令名称的由来:该命令只是
取消链接键与键空间的关联。实际的删除
将在稍后异步进行。