Tyson Andre 6f11acbd67
Implement SMISMEMBER key member [member ...] (#7615)
This is a rebased version of #3078 originally by shaharmor
with the following patches by TysonAndre made after rebasing
to work with the updated C API:

1. Add 2 more unit tests
   (wrong argument count error message, integer over 64 bits)
2. Use addReplyArrayLen instead of addReplyMultiBulkLen.
3. Undo changes to src/help.h - for the ZMSCORE PR,
   I heard those should instead be automatically
   generated from the redis-doc repo if it gets updated

Motivations:

- Example use case: Client code to efficiently check if each element of a set
  of 1000 items is a member of a set of 10 million items.
  (Similar to reasons for working on #7593)
- HMGET and ZMSCORE already exist. This may lead to developers deciding
  to implement functionality that's best suited to a regular set with a
  data type of sorted set or hash map instead, for the multi-get support.

Currently, multi commands or lua scripting to call sismember multiple times
would almost definitely be less efficient than a native smismember
for the following reasons:

- Need to fetch the set from the string every time
  instead of reusing the C pointer.
- Using pipelining or multi-commands would result in more bytes sent
  and received by the client for the repeated SISMEMBER KEY sections.
- Need to specially encode the data and decode it from the client
  for lua-based solutions.
- Proposed solutions using Lua or SADD/SDIFF could trigger writes to
  memory, which is undesirable on a redis replica server
  or when commands get replicated to replicas.

Co-Authored-By: Shahar Mor <shahar@peer5.com>
Co-Authored-By: Tyson Andre <tysonandre775@hotmail.com>
2020-08-11 11:55:06 +03:00
..
2020-07-21 08:13:05 +03:00
2020-05-02 21:19:47 +08:00
2019-11-20 20:39:04 -05:00
2019-07-17 16:40:24 +03:00
2020-05-05 10:20:48 +02:00
2020-04-24 17:00:03 -07:00
2020-04-24 17:11:21 -07:00
2020-04-24 17:11:21 -07:00
2020-08-06 16:47:27 +03:00
2020-07-21 08:13:05 +03:00
2018-07-03 18:19:46 +02:00
2019-02-24 21:38:15 +01:00
2020-06-12 12:16:19 +02:00
2019-10-24 14:24:55 +03:00
2020-06-16 17:50:38 +08:00
2020-05-05 23:35:08 -04:00
2019-11-19 17:23:47 +08:00
2020-08-02 13:59:51 +03:00
2020-04-02 23:43:47 +08:00
2020-04-09 12:10:10 +02:00
2020-08-08 11:59:17 -07:00
2018-07-03 18:19:46 +02:00
2019-10-02 11:30:20 +02:00
2020-07-24 14:40:19 +08:00
2020-04-06 19:27:06 +08:00
2020-08-08 00:19:18 +03:00
2020-02-22 11:38:51 -05:00
2020-08-08 12:28:44 -07:00
2020-05-12 21:21:22 +01:00
2018-11-11 18:49:55 +00:00
2020-06-24 09:09:43 +02:00
2020-07-21 08:13:05 +03:00