Skip to content

Comment on Using Redis SORT and GET to save on roundtrips

Comments

no need to sort by a non existing key, all you need is that the BY pattern does not contain an asterisk, so it is constant, that means all the elements have the same value for sorting, and Redis knows that it can skip it and use the List natural ordering.

It is interesting that you can ask for single elements of an hash, like in: GET object:*->field

With 2.6 and scripting this kind of optimizations will become the rule.

Ah no asterisk means nothing to replace, makes sense.

Excited for 2.6 and scripting. Has much changed on the scripting side since the 2.2-scripting branch?

Good point, but surely using a key like nosort makes the intent clearer.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.