djveremix / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

Pagination for sets #227

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Feature request: It would be great to (somehow) have pagination for sets. I'm 
using sets to store 
Twitter social graph data and while SMEMBERS works in most instances, it can 
easily become a 
burden with specific edge cases. I'm not sure if pagination is even possible 
with sets, but it would be 
nice.

Original issue reported on code.google.com by d.lifeha...@gmail.com on 12 Apr 2010 at 7:08

GoogleCodeExporter commented 9 years ago
Pagination implies order in your data. When you store stuff in a set, you lose 
all order. Therefore, it's not 
possible to add pagination for sets. If with pagination you mean chunked 
response (return N items per reply), it's 
not possible to guarantee consistency across your responses when you specify an 
offset.

If you absolutely need pagination, you could consider a hybrid solution with 
both sets and lists. You can then 
use LRANGE to implement pagination yourself.

Original comment by pcnoordh...@gmail.com on 12 Apr 2010 at 8:57