Describe the bug

https://redis.io/docs/latest/commands/zpopmin/ has a time complexity of O(log(N)*M) While https://redis.io/docs/latest/commands/zremrangebyrank/ + https://redis.io/docs/latest/commands/zrange/ (combined) have 2*O(log(N)+M)

This means that for all practical use cases (unless you have really low number of N/keys in redis) using the zpopmin is slower than running both commands.

Is this true or is the documentation wrong? Why is that the case? (since they do the same thing, so it's unclear to me how zpopmin is slower)

Comment From: sundb

  1. time complexity O does not represent the true running time, it only represents the complexity of the algorithm.
  2. 2*O(log(N)+M) is not correctly, in fact, it's still O(log(N)+M), M represents the sum of the M of your two commands. when N or M approaches infinite, 2 is negligible and O is just an expression of the approach.