New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZREVRANGEBYLEX not in documentation #398

Closed
hostilefork opened this Issue Aug 4, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@hostilefork

hostilefork commented Aug 4, 2014

While writing an automated processor which combines information from the redis C table with the documentation, it noticed that zrevrangebylex is in the command table but not in the commands.json file:

https://github.com/antirez/redis/blob/78a012d81a0f487b92b2b79a91de1f28697100e8/src/redis.c#L185

Just thought I'd let you know. :-)

I'm assuming its performance profile is the same as ZRANGEBYLEX:

"O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N))."

I mention that one in particular because it is user facing and I'd say it's fairly certain it should be documented. Though here's the others that don't have documentation, and some may be omitted on purpose:

  • latency
  • pfdebug
  • pfselftest
  • psync
  • replconf
  • restore-asking
  • readonly
  • readwrite
@badboy

This comment has been minimized.

Show comment
Hide comment
@badboy

badboy Aug 4, 2014

Collaborator

Good catch. Care to write the documentation? Should be mostly a copy&paste from zrangebylex, right?

Collaborator

badboy commented Aug 4, 2014

Good catch. Care to write the documentation? Should be mostly a copy&paste from zrangebylex, right?

@hostilefork

This comment has been minimized.

Show comment
Hide comment
@hostilefork

hostilefork Aug 5, 2014

Well I'm probably not the best person to do it, as I know very little about Redis. But "blame" shows it being added in this commit:

antirez/redis@3a6a1e4

Which has a version stamp of 2.9.11. I'd just guess it would be:

"ZREVRANGEBYLEX": {
"summary": "Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings.",
"complexity": "O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).",
"arguments": [
  {
    "name": "key",
    "type": "key"
  },
  {
    "name": "max",
    "type": "string"
  },
  {
    "name": "min",
    "type": "string"
  },
  {
    "command": "LIMIT",
    "name": ["offset", "count"],
    "type": ["integer", "integer"],
    "optional": true
  }
],
"since": "2.9.11",
"group": "sorted_set"
},

Because it looks like the min and max are reversed.

hostilefork commented Aug 5, 2014

Well I'm probably not the best person to do it, as I know very little about Redis. But "blame" shows it being added in this commit:

antirez/redis@3a6a1e4

Which has a version stamp of 2.9.11. I'd just guess it would be:

"ZREVRANGEBYLEX": {
"summary": "Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings.",
"complexity": "O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).",
"arguments": [
  {
    "name": "key",
    "type": "key"
  },
  {
    "name": "max",
    "type": "string"
  },
  {
    "name": "min",
    "type": "string"
  },
  {
    "command": "LIMIT",
    "name": ["offset", "count"],
    "type": ["integer", "integer"],
    "optional": true
  }
],
"since": "2.9.11",
"group": "sorted_set"
},

Because it looks like the min and max are reversed.

@badboy

This comment has been minimized.

Show comment
Hide comment
@badboy

badboy Aug 5, 2014

Collaborator

Thanks. I'll add this as a pull request

Collaborator

badboy commented Aug 5, 2014

Thanks. I'll add this as a pull request

@badboy

This comment has been minimized.

Show comment
Hide comment
@badboy

badboy Aug 5, 2014

Collaborator

For the rest:

  • latency is handled here: http://redis.io/topics/latency-monitor. We should link to it from the commands page
  • readonly/readwrite should be documented, as they are important when using Cluster
  • pfdebug should be added, it's a debug command after all and can be useful
  • The rest is only for internal/Cluster-related stuff. Not sure if these need user-facing documentation.
Collaborator

badboy commented Aug 5, 2014

For the rest:

  • latency is handled here: http://redis.io/topics/latency-monitor. We should link to it from the commands page
  • readonly/readwrite should be documented, as they are important when using Cluster
  • pfdebug should be added, it's a debug command after all and can be useful
  • The rest is only for internal/Cluster-related stuff. Not sure if these need user-facing documentation.

@soveran soveran closed this in #399 Oct 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment