Multi column range query

31 views
Skip to first unread message

Matija Papec

unread,
Oct 2, 2015, 6:14:49 AM10/2/15
to Redis DB

I have two sorted sets, and want to make intersection, ie. (age BETWEEN 25, 35) AND (salary BETWEEN 250, 350)

Is there a better way regarding efficiency than:

ZUNIONSTORE t_age 1 age WEIGHTS 1
ZREMRANGEBYSCORE t_age -inf (25
ZREMRANGEBYSCORE t_age (35 +inf
ZINTERSTORE result 2 salary t_age WEIGHTS 1
ZRANGEBYSCORE result 250 350

Tnx in advance.


Matija Papec

unread,
Oct 4, 2015, 1:20:19 PM10/4/15
to Redis DB
Reply all
Reply to author
Forward
0 new messages