TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using Redis SORT and GET to save on roundtrips

64 pointsby trentonstrongover 13 years ago

4 comments

antirezover 13 years ago
no need to sort by a <i>non existing</i> 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.<p>It is interesting that you can ask for single elements of an hash, like in: GET object:*-&#62;field<p>With 2.6 and scripting this kind of optimizations will become the rule.
评论 #3358361 未加载
评论 #3359508 未加载
salimaneover 13 years ago
this assume you're connecting to <i>one</i> redis server and not running a cluster of redis servers, or have tagged the keys being requested in a cluster of redis servers
评论 #3360023 未加载
estover 13 years ago
<a href="http://redis.io/commands/sort" rel="nofollow">http://redis.io/commands/sort</a><p>Learned so much today!
durbinover 13 years ago
good point.