News for hackers. Stuff that matters.
Re:Thredis is Redis + SQL + Threads by blibble on Thursday January 24, 2013 @12:24PM (#5110759)
you can make your own iterator over sorted sets pretty easily with zrange
Re:Thredis is Redis + SQL + Threads by gtrubetskoy on Thursday January 24, 2013 @12:43PM (#5110869)
True, but not quite. The first thing zrange does is look for the starting point, which is an approximately O(log(N)) for a skiplist (which is how it's implemented). An iterator's next() operation should be O(1). If I need to iterate over a gazillion elements, it would make a huge difference. Or course you could zrange chunks, and it would be more efficient, but what's wrong with a simple START and NEXT semantic?

BUT this is all a moot point - a Sorted Set is not the type of structure that something like SQLite4 needs anyway. The keys should be sorted lexicographically, not by score. I think a Skip List fits the bill perfectly, and Redis already contains an implementation of it (as part of Sorted Sets), why not expose it as a standalone type?