- Mastering Redis
- Jeremy Nelson
- 200字
- 2021-04-02 20:37:58
Advanced sorted set operations
Similarly to sets, sorted sets in Redis support the set operations of union and intersection, although the time complexity of these operations for sorted sets is worse than for sets. Another problem with the sorted set operations is that when using a Redis cluster, union and intersection operations can only be used when the sorted set keys have been sharded to the same hash slot and run on the same node. The ZINTERSTORE
Redis command has a time complexity of O(nk)+O(mlog(m))
, where n is the size of the smallest sorted set; k, the total number of sorted sets being intersected, and m, the number of elements in the resulting final sorted set. Likewise, for the ZUNIONSTORE
command, the time complexity is O(n)+O(M log(M))
with n being the total size of all the sorted sets and m being the total number of elements in the final sorted set. Given the characteristics of sorted sets, the additional time required for these two set operations may be an acceptable trade-off. It is good to keep in mind this difference in performance between large sets and sorted sets irrespective of whether the data and your requirements require ordering or not.
- 中文版After Effects CC實(shí)用教程
- Sencha Touch Cookbook, Second Edition
- Premiere Pro 2022從新手到高手
- VSTO 3.0 for Office 2007 Programming
- R Graph Cookbook
- UG NX 完全實(shí)例解析
- 大規(guī)模組織DevOps實(shí)踐
- AutoCAD 2016中文版完全自學(xué)手冊
- SPSS統(tǒng)計(jì)分析
- After Effects 2022從入門到精通
- PHP and MongoDB Web Development Beginner's Guide
- 構(gòu)筑敏捷的開發(fā)團(tuán)隊(duì):微軟Visual Studio 2010實(shí)戰(zhàn)兵法
- Cassandra High Performance Cookbook
- 會聲會影X8 DV影片制作/編輯/刻盤實(shí)戰(zhàn)從入門到精通
- 中老年學(xué)微信(圖解大字版)