DiceDB / dice

DiceDB is hyper-optimized for building and scaling truly real-time applications on modern hardware. It is a drop-in replacement for Redis with support for SQL-based reactivity.
https://dicedb.io/
Other
3.32k stars 420 forks source link

Added wildcard matching for DSQL query #169

Closed Dev79844 closed 1 month ago

Dev79844 commented 1 month ago

Issue: #167

Summary:

Added wildcard matching for DSQL queries.

Changes:

Test

Benchmark test

RegexMatch

Screenshot 2024-07-24 at 2 09 50 PM

WildCardMatch

Screenshot 2024-07-24 at 2 14 31 PM
Dev79844 commented 1 month ago

Hey @JyotinderSingh! I have done the changes and added the screenshots of benchmarks for RegexMatch and WildCardMatch in PR description. Kindly have a look at it.

JyotinderSingh commented 1 month ago

Hey @JyotinderSingh! I have done the changes and added the screenshots of benchmarks for RegexMatch and WildCardMatch in PR description. Kindly have a look at it.

This is an amazing performance improvement! I think we can remove the old regex matching code (and related test/benchmark) altogether. The PR should be ready to merge after that.

Dev79844 commented 1 month ago

Hey @JyotinderSingh! RegexMatch is also being used in WatchKeys function in async_tcp.go file. I don't think I can remove it unless I replace the RegexMatch with WildCardMatch in WatchKeys function too.

JyotinderSingh commented 1 month ago

Hey @JyotinderSingh!

RegexMatch is also being used in WatchKeys function in async_tcp.go file. I don't think I can remove it unless I replace the RegexMatch with WildCardMatch in WatchKeys function too.

Even that can make use of the new wildcard function. All present usages of this method have the same purpose - to find keys that match a given wildcard pattern

JyotinderSingh commented 1 month ago

Please rebase your PR on the latest master, there are merge conflicts.

Dev79844 commented 1 month ago

Resolved the merge conflict

JyotinderSingh commented 1 month ago

Thank you for the contribution!