-- This Lua script counts the number of keys with hash values using KEYS
local keys = redis.call("KEYS", "*")
local count = 0
local hash = 0

for _, key in ipairs(keys) do
    -- Check if the key is a hash
    if redis.call("TYPE", key).ok == "hash" then
        hash = hash + 1
    end
    if redis.call("TYPE", key).ok == "string" then
        count = count + 1
    end
end

return {count, hash}

