kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

Allow to scan keys with the suffix

Open baobaomaomeng opened this issue 1 year ago • 7 comments

After modifying the code, I'm encountering some strange issues. I don't understand why this test is failing.

first

second

third At the same time, there's a bit of a performance issue. I'm not sure about the optimal number of scans for substring matching and suffix matching, I haven't set a limit yet. In the next couple of days, I'll try to add support for HSCAN, SSCAN, and ZSCAN.

baobaomaomeng avatar Apr 04 '24 16:04 baobaomaomeng

@baobaomaomeng You can add a config to set the optimal number. We can talk about the default value later. If this test case doesn't your need, you can hide it in your local. You can use ./x.py check format to format the code.

jihuayu avatar Apr 05 '24 01:04 jihuayu

@baobaomaomeng You can add a config to set the optimal number. We can talk about the default value later. If this test case doesn't your need, you can hide it in your local. You can use ./x.py check format to format the code.

I've now added some tests,add support hsacn zscan and SSCAN, and the final step is to add configuration options. I'm not sure how to add configuration options, nor do I know what a good default number of search times would be. I feel like I need some help in this area.

baobaomaomeng avatar Apr 14 '24 15:04 baobaomaomeng

@baobaomaomeng That's great, thank you for your efforts.

Regarding how to add configuration items, you can refer to this PR.

The default number may be any number(such as 100,000). We can have the Reviewers confirm the final value, this modification is quite simple.

jihuayu avatar Apr 14 '24 23:04 jihuayu

@baobaomaomeng That's great, thank you for your efforts.

Regarding how to add configuration items, you can refer to this PR.

The default number may be any number(such as 100,000). We can have the Reviewers confirm the final value, this modification is quite simple.

One point that confuses me is why the limit in the scan operator is not a configuration item, and now I need to add the maximum number to scan at once into the configuration items.

baobaomaomeng avatar Apr 16 '24 16:04 baobaomaomeng

@baobaomaomeng Hi, can you resolve the conflicts?

jihuayu avatar Apr 24 '24 08:04 jihuayu

In my opinion, we need a well-designed solution for implementing Redis glob-style patterns that is scalable, rather than just handling specific cases. If the design is not scalable, we may have to remove all modifications when aiming to support the complete pattern cases.

PragmaTwice avatar May 04 '24 06:05 PragmaTwice

In my opinion, we need a well-designed solution for implementing Redis glob-style patterns that is scalable, rather than just handling specific cases. If the design is not scalable, we may have to remove all modifications when aiming to support the complete pattern cases.

Thank you for your review, but this is not consistent with the goal I communicated at the beginning. I now need to rewrite my code, and I think I need to consider how to write it.Could you give me some reference suggestions?

baobaomaomeng avatar May 04 '24 08:05 baobaomaomeng