0

I have a large map, which maps skuIds (strings, e.g.: AB-1 to "hola") to names; the skuIds are unique, but the names are not.

There are about 1 million skuIds mapped to about 1000 unique names. Now I need to get the unique name list for any subset of the skuId set.

I tried hashmap's hmget, but retrieving millions of records and looping through is not effiecient; then I tried using the Sorted sets, (kept the same score for same name), but then I needed the set of scores for a sorted set, which is not provided directly by redis.

We can do this by using a Lua script (taking about 10-15 seconds), but I am not sure about disadvantages of having Lua scripts in the code.

Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
prasanna
  • 14
  • 2
  • What do you mean by "but then I needed the set of scores for a sorted set, which is not provided directly by redis"? – Itamar Haber Jan 28 '16 at 07:57

1 Answers1

0

Use HSCAN for that. Also look at this answer about HSCAN usage.

Community
  • 1
  • 1
Nick Bondarenko
  • 6,211
  • 4
  • 35
  • 56