faster redis lookup for collection of keys -


i'm looking faster way lookup collection of keys in redis.

that's need do:

hget "user:001:coins" "2013-05-01" 

it looks stored coins user on specific day.

now want lookup stored coins date range of month:

hget "user:001:coins" "2013-05-01" hget "user:001:coins" "2013-05-02" .... 

thats getting slow becasue have 120 different users on 2 months. there faster/better way ?

one idea had add key holds calculated coins amount month, , recalculate key if there change.

hget "user:001:coins" "2013-05" 

but mean additional programming logic, avoid.

restructuring data not bad idea if require additional work. fetching once faster fetching n times.

if can group operations together, why not use hmget?

hmget "user:001:coins" "2013-05-01" "2013-05-02" ... 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -