redis mget vs pipeline

389 views
Skip to first unread message

Shushant Arora

unread,
Nov 5, 2017, 6:04:52 AM11/5/17
to Redis DB
Hi

I have multiple keys to fetch from redis , which one is more performant mget or pipeline ?

Jan-Erik Rediger

unread,
Nov 5, 2017, 6:18:39 AM11/5/17
to redi...@googlegroups.com
Why not test it?

From a purely speculative point of view I'd say MGET:

* Only one command to be parsed
* One path through the code collecting the values
* List of values in a single answer might safe a tiny bit of bytes.
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at https://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/d/optout.

Shushant Arora

unread,
Nov 5, 2017, 6:48:15 AM11/5/17
to redi...@googlegroups.com, Jan-Erik Rediger
and if multiple keys are hash keys from different fields , can mget be used ? And if I go for hmgetall can I use multiple hmgetall in one go  without pipeline ?

On Sun, Nov 5, 2017 at 4:48 PM, Jan-Erik Rediger <jan...@fnordig.de> wrote:
Why not test it?

From a purely speculative point of view I'd say MGET:

* Only one command to be parsed
* One path through the code collecting the values
* List of values in a single answer might safe a tiny bit of bytes.

On Sun, Nov 05, 2017 at 03:04:52AM -0800, Shushant Arora wrote:
> Hi
>
> I have multiple keys to fetch from redis , which one is more performant
> mget or pipeline ?
>
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at https://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Redis DB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/redis-db/p2uVXE1g8kA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to redis-db+unsubscribe@googlegroups.com.

ma...@andyh.io

unread,
Nov 5, 2017, 7:08:50 AM11/5/17
to redi...@googlegroups.com, Jan-Erik Rediger
You can.

The answer can be easily found out by sending the commands to a Redis server. If you really don't want to install a Redis server, you can try at the Redis documentation page which provides a sandbox page where you can try the commands.

Andy

Sent from my iPhone
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.

ma...@andyh.io

unread,
Nov 5, 2017, 7:37:02 AM11/5/17
to redi...@googlegroups.com, Jan-Erik Rediger
Correction: MGET only works for string value commands. 

Sent from my iPhone

On Nov 5, 2017, at 20:48, Shushant Arora <shushan...@gmail.com> wrote:

To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages