小编Are*_*esn的帖子

在Redis中存储32位有符号整数的内存有效方法

由于Redis尝试将字符串解析为64位有符号整数,因此存储32位有符号整数的二进制表示而不是基数10整数字符串是个好主意吗?

在我们的系统中,我们列出了许多32位有符号整数ID.

I can store them like
lpush mykey 102450  --> redis cast 102450 to 8 bytes long

or store it like 
lpush mykey  \x00\x01\x19\x32  ---> this is just 4 bytes
Run Code Online (Sandbox Code Playgroud)

redis

9
推荐指数
1
解决办法
3729
查看次数

标签 统计

redis ×1