我不相信redis缓存命令的结果,对吗?如果是这样,那么为什么我会在我的redis服务器上看到相同查询的以下内容。作为参考,这是在VM中运行的redis。我按照http://redis.io/topics/latency中的描述检查了smaps文件,看不到操作系统级别的交换(交换过程中所有0kb的流程),但是有可能在VM中运行redis将内存存储到磁盘并返回吗?或者......由于对常用命令进行某种redis优化,预计会得到这些结果吗?
redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(4.46s)
redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(3.77s)
redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(0.92s)
redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(0.64s)
redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(0.67s)
redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(0.73s)
redis 127.0.0.1:6379[4]> scard ClientId:1637
(integer) 796529
redis 127.0.0.1:6379[4]> scard PublisherId:1
(integer) 311092
redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(1.88s)
redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(0.69s)