Skip to content

fixed complexity of bzmpop and zmpop commands#11026

Merged
oranagra merged 2 commits intoredis:unstablefrom
pavel-krush:unstable
Jul 24, 2022
Merged

fixed complexity of bzmpop and zmpop commands#11026
oranagra merged 2 commits intoredis:unstablefrom
pavel-krush:unstable

Conversation

@pavel-krush
Copy link
Contributor

@pavel-krush pavel-krush commented Jul 22, 2022

Swap M and N in the complexity formula of [B]ZMPOP
#11022

Copy link
Contributor

@enjoy-binbin enjoy-binbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please try to run python3 utils/generate-command-code.py
or just modify command.c, i am sure you can find it

{"bzmpop","Remove and return members with scores in a sorted set or block until one is available","O(K) + O(N*log(M)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped.","7.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SORTED_SET,BZMPOP_History,BZMPOP_tips,bzmpopCommand,-5,CMD_WRITE|CMD_BLOCKING,ACL_CATEGORY_SORTEDSET,{{NULL,CMD_KEY_RW|CMD_KEY_ACCESS|CMD_KEY_DELETE,KSPEC_BS_INDEX,.bs.index={2},KSPEC_FK_KEYNUM,.fk.keynum={0,1,1}}},blmpopGetKeys,.args=BZMPOP_Args},

{"zmpop","Remove and return members with scores in a sorted set","O(K) + O(N*log(M)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped.","7.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_SORTED_SET,ZMPOP_History,ZMPOP_tips,zmpopCommand,-4,CMD_WRITE,ACL_CATEGORY_SORTEDSET,{{NULL,CMD_KEY_RW|CMD_KEY_ACCESS|CMD_KEY_DELETE,KSPEC_BS_INDEX,.bs.index={1},KSPEC_FK_KEYNUM,.fk.keynum={0,1,1}}},zmpopGetKeys,.args=ZMPOP_Args},

Copy link
Contributor

@enjoy-binbin enjoy-binbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, LGTM

@oranagra oranagra linked an issue Jul 24, 2022 that may be closed by this pull request
@oranagra oranagra merged commit 5879e49 into redis:unstable Jul 24, 2022
oranagra pushed a commit that referenced this pull request Sep 21, 2022
Swap M and N in the complexity formula of [B]ZMPOP

Co-authored-by: Pavel Krush <[email protected]>
(cherry picked from commit 5879e49)
enjoy-binbin pushed a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
Swap M and N in the complexity formula of [B]ZMPOP

Co-authored-by: Pavel Krush <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

BZMPOP ZMPOP complexity

3 participants