Redis 是否可以使用 mset 更新多个 hset 键(不是字段) [英] Redis is it possible to update multiple hset keys(not fields) using mset

查看:109
本文介绍了Redis 是否可以使用 mset 更新多个 hset 键(不是字段)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将 MSET 用于 HSET 键?我正在尝试在单个操作中更新多个 HSET 键(不是字段)以节省网络流量.

Is there a way to use MSET for HSET keys ? I am trying to update multiple HSET keys(not fields) in a single operation to save on network traffic.

推荐答案

为了节省网络行程,您需要使用流水线.使用 Lua 是可能的,但不像流水线那样可调,您可以在流水线中找到并设置每次执行数据集的最佳命令数.

To save on network trips, you'll want to use pipelining. Using Lua is possible, but not as tunable as pipelining where you can find and set the optimum number of commands per execute for your dataset.

此外,您还可以获得可重复使用技术的经验.

And as an added bonus you get experience with a re-usable technique.

这篇关于Redis 是否可以使用 mset 更新多个 hset 键(不是字段)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆