I implement Redis ZSet commands by RocksDB, and iterator is really slow with big key, how can I optimize these key-values?
I devide 1 zset key-element-score with 3 RocksDB key-values, such as name2age:linda:25
meta key:
"name2age": 1
// count one element, use for zcardindex key:
"name2age:linda": 25
// use for zrangebyindexscore key:
"name2age:25:linda": NULL
// use for zrangebyscore
// using rocksdb iterate to start index, count offset, and select elements
// this will be slow when zset have too many elements
I want a new implementation to rewrite zset, maybe some tips, thanks a lot