-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Optimize the logic of the HIncrby command with MergeOperator (Merge) #2843
Comments
坏处:
|
harm:
|
wangshaoyi |
Wang Shaoyi |
使用merge操作符,读性能应该也会有下降吧? |
When using the merge operator, the read performance should also be reduced, right? |
|
|
|
|
|
|
get操作不会在rocksdb产生新key吧?所以除非你上层有cache,否则每次读都可能读多个文件。 |
The get operation will not generate a new key in rocksdb, right? So unless you have a cache in the upper layer, multiple files may be read each time. |
是,你说的没错,我之前验证的时候忘记关闭 pika cache 了,我刚才验证了你说的是正确的,看来 merge 并不适用 hincrby 这块的场景。 |
Yes, you are right. I forgot to turn off pika cache when I verified it before. I just verified that what you said is correct. It seems that merge is not applicable to the hincrby scenario. |
Which PikiwiDB functionalities are relevant/related to the feature request?
No response
Description
https://github.com/johnzeng/rocksdb-doc-cn/blob/master/doc/Merge-Operator.md
原来的 Hincrby 命令是先 get meta,然后 get data,然后 put data,现在是 get meta,然后 merge data。merge 还有一个好处就是不阻塞,肯定会比 put 快一点,当有 compact 或者 get 的时候,merge 才会被计算。但是在 HIncrby 命令中使用 Merge 有一个缺点:无法处理 overflow 的情况。因为原来会 get data,然后可以判断旧的数据和新的数据相加会不会溢出,但是现在将读旧数据的逻辑放 merge 中了,这块就不能处理溢出情况,因为无论如何,merge 不能处理失败必须返回 true。
Proposed solution
none
Alternatives considered
none
The text was updated successfully, but these errors were encountered: