Permalink
Browse files

correct a little mistake, `zremrangebyscore` is about sorted set not …

…list.

`list` -> `set`.
  • Loading branch information...
JasonLai256 committed Feb 27, 2012
1 parent 9345be3 commit 368d23acaf3e9bd9ffeeee133689ccc0eaac7d9c
Showing with 1 addition and 1 deletion.
  1. +1 −1 en/redis.md
View
@@ -323,7 +323,7 @@ Logarithmic, or O(log(N)), is the next fastest possibility because it needs to s
Next we have linear commands, or O(N). Looking for a non-indexed column in a table is an O(N) operation. So is using the `ltrim` command. However, in the case of `ltrim`, N isn't the number of elements in the list, but rather the elements being removed. Using `ltrim` to remove 1 item from a list of millions will be faster than using `ltrim` to remove 10 items from a list of thousands. (Though they'll probably both be so fast that you wouldn't be able to time it.)
-`zremrangebyscore` which removes elements from a sorted set with a score between a minimum and a maximum value has a complexity of O(log(N)+M). This makes it a mix. By reading the documentation we see that N is the number of total elements in the set and M is the number of elements to be removed. In other words, the number of elements that'll get removed is probably going to be more significant, in terms of performance, than the total number of elements in the list.
+`zremrangebyscore` which removes elements from a sorted set with a score between a minimum and a maximum value has a complexity of O(log(N)+M). This makes it a mix. By reading the documentation we see that N is the number of total elements in the set and M is the number of elements to be removed. In other words, the number of elements that'll get removed is probably going to be more significant, in terms of performance, than the total number of elements in the set.
The `sort` command, which we'll discuss in greater detail in the next chapter has a complexity of O(N+M*log(M)). From its performance characteristic, you can probably tell that this is one of Redis' most complex commands.

0 comments on commit 368d23a

Please sign in to comment.