You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "jishengming1 (via GitHub)" <gi...@apache.org> on 2025/06/10 07:04:27 UTC
Re: [PR] feat(keys, scan): Support arbitrary glob patterns [kvrocks]
jishengming1 commented on code in PR #2608:
URL: https://github.com/apache/kvrocks/pull/2608#discussion_r2137079243
##########
src/storage/redis_db.cc:
##########
@@ -366,6 +368,10 @@ rocksdb::Status Database::Scan(engine::Context &ctx, const std::string &cursor,
if (metadata.Expired()) continue;
std::tie(std::ignore, user_key) = ExtractNamespaceKey<std::string>(iter->key(), storage_->IsSlotIdEncoded());
+
+ if (!util::StringMatch(suffix_glob, user_key.substr(prefix.size()))) {
+ continue;
+ }
keys->emplace_back(user_key);
cnt++;
Review Comment:
In this code, we replace `user_key.substr(prefix.size())` with `std::string_view(user_key).substr(prefix.size())`, which seems to offer better performance, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org