So I've taken a look at the redis docs as well as the question here about the redis internal data structures, but without going through the redis source I can't seem to get an answer as to what the data type is for the "score" of a sorted list.
The reason I ask is that I think I want a sorted set, let's call it "CHH", where the score is like the following: "{u64}~{int}", and then my value is a big comma separated value string of "stuff" for my app, guaranteed to be uniqueish for the given score.
All of the examples that Ive seen have generally shown the score as a simple integer value, thought they say it can be lexagraphically (sp?) compared. Is there a size limit for the score? What is its internal representation?
In Redis, a rank is a zero-based index of the members of a sorted set, ordered by their score. For example, "Joe Pass" has a score of 1 , but because that is the lowest score of any member in the key, it has a rank of 0 : zrank faveGuitarists "Joe Pass"
Redis lists are lists of strings sorted by insertion order.
A Redis sorted set is a collection of unique strings (members) ordered by an associated score. When more than one string has the same score, the strings are ordered lexicographically. Some use cases for sorted sets include: Leaderboards.
Redis - Sorted Set Zinterstore Command Redis ZINTERSTORE command computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in the destination. It is mandatory to provide the number of input keys (numkeys) before passing the input keys and the other (optional) arguments.
Redis sorted sets use a double 64-bit floating point number to represent the score. In all the architectures we support, this is represented as an IEEE 754 floating point number, that is able to represent precisely integer numbers between -(2^53) and +(2^53) included. In more practical terms, all the integers between -9007199254740992 and 9007199254740992 are perfectly representable. Larger integers, or fractions, are internally represented in exponential form, so it is possible that you get only an approximation of the decimal number, or of the very big integer, that you set as score.
http://redis.io/commands/zadd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With