Commands
184 commands
Every verb the server will answer, straight from its own registry — the same table COMMAND DOCS reads. Two columns you will not find in Redis's reference: what the command costs in this engine, and how it differs from Redis.
| Commands | Group | Complexity | Redis compatibility | Summary |
|---|---|---|---|---|
| APPEND | String | O(1) amortised while the value is <= 6… | Compatible | Append bytes to a string value; returns the new length. |
| DECR | String | O(1) | Compatible | Decrement the integer value of a key by one. |
| DECRBY | String | O(1) | Compatible | Decrement the integer value of a key by the given amount. |
| GET | String | O(1) | Compatible | Return the string value of a key. |
| GETDEL | String | O(1) | Compatible | Return the string value of a key and delete it. |
| GETSET | String | O(1) | Compatible | Set a key's string value and return its previous value. |
| INCR | String | O(1) | Compatible | Increment the integer value of a key by one. |
| INCRBY | String | O(1) | Compatible | Increment the integer value of a key by the given amount. |
| INCRBYFLOAT | String | O(1) | Differs | Increment the float value of a key by the given amount. |
| MGET | String | O(N) keys, one O(1) probe each on the… | Differs | Return the values of multiple keys (cross-shard gather). |
| MSET | String | O(N) pairs, one O(1) SET each | Differs | Set multiple key/value pairs atomically per shard. |
| PSETEX | String | O(1) | Compatible | Set a key's value with a TTL in milliseconds. |
| SET | String | O(1) | Differs | Set a key's string value with optional TTL and existence conditions. |
| SETEX | String | O(1) | Compatible | Set a key's value with a TTL in seconds. |
| SETNX | String | O(1) | Compatible | Set a key's value only if it does not exist. |
| STRLEN | String | O(1) | Compatible | Return the length of a key's string value. |
| DEL | Generic | O(N) keys, plus O(M) per key holding a… | Differs | Delete one or more keys. |
| EXISTS | Generic | O(N) keys, one O(1) probe each | Differs | Count how many of the given keys exist. |
| EXPIRE | Generic | O(1) | Differs | Set a key's TTL in seconds (non-positive TTL deletes the key). |
| EXPIREAT | Generic | O(1) | Differs | Set a key's expiry as an absolute Unix timestamp in seconds. |
| PERSIST | Generic | O(1) | Compatible | Remove a key's TTL. |
| PEXPIRE | Generic | O(1) | Differs | Set a key's TTL in milliseconds. |
| PEXPIREAT | Generic | O(1) | Differs | Set a key's expiry as an absolute Unix timestamp in milliseconds. |
| PTTL | Generic | O(1) | Compatible | Return a key's remaining TTL in milliseconds (-1 no TTL, -2 missing). |
| RENAME | Generic | O(1) for a string value | Differs | Rename a key, overwriting the destination (write routed at the runtime Op level). |
| RENAMENX | Generic | O(1) for a string value | Differs | Rename a key only if the destination does not exist (write routed at the runtime Op level). |
| TTL | Generic | O(1) | Compatible | Return a key's remaining TTL in seconds (-1 no TTL, -2 missing). |
| TYPE | Generic | O(1) | Compatible | Return the type of the value stored at key. |
| UNLINK | Generic | O(N) keys, plus O(M) per collection-ty… | Differs | Delete one or more keys (alias of DEL in kevy's shard model). |
| KEYS | Keyspace scan | O(N) keys in the whole keyspace | Compatible | Return every key matching the glob pattern (cross-shard gather). |
| RANDOMKEY | Keyspace scan | O(1) expected | Differs | Return a random key from the keyspace. |
| SCAN | Keyspace scan | O(N) keys in the WHOLE keyspace, on ev… | Differs | Sweep the keyspace and return every match at once; NOT a cursor iterator (COUNT and TYPE are accepted and ignored, and the cursor is always 0). |
| BLPOP | List | O(1) to serve | Differs | Blocking left pop across one or more lists (effect logged as LPOP). |
| BRPOP | List | O(1) to serve | Differs | Blocking right pop across one or more lists (effect logged as RPOP). |
| BRPOPLPUSH | List | O(1) to serve | Differs | Blocking RPOPLPUSH: pop the source tail and push it onto the destination head. |
| LINDEX | List | O(1) | Compatible | Return the element at the given list index. |
| LLEN | List | O(1) | Compatible | Return the length of a list. |
| LMOVE | List | O(1) | Differs | Atomically move an element between two lists. |
| LPOP | List | O(C) elements popped | Differs | Pop one or more elements from the head of a list. |
| LPOS | List | O(N) always | Compatible | Return the index of matching elements in a list. |
| LPUSH | List | O(M) values, O(1) amortised each | Compatible | Prepend one or more elements to a list. |
| LRANGE | List | O(M) elements returned | Compatible | Return a range of list elements. |
| LREM | List | O(N*R) worst case | Compatible | Remove elements equal to the given value from a list. |
| LSET | List | O(1) | Compatible | Set the list element at the given index. |
| LTRIM | List | O(R) elements removed | Compatible | Trim a list to the given range. |
| RPOP | List | O(C) elements popped | Differs | Pop one or more elements from the tail of a list. |
| RPOPLPUSH | List | O(1) | Differs | Pop the source tail and push it onto the destination head. |
| RPUSH | List | O(M) values, O(1) amortised each | Compatible | Append one or more elements to a list. |
| HDEL | Hash | O(M) fields | Compatible | Delete one or more hash fields. |
| HEXISTS | Hash | O(1) | Compatible | Check whether a hash field exists. |
| HEXPIRE | Hash | O(F) fields in the FIELDS clause | Differs | Set per-field TTLs on a hash, in seconds. |
| HGET | Hash | O(1) | Compatible | Return the value of a hash field. |
| HGETALL | Hash | O(N) fields, with a full copy of every… | Compatible | Return all fields and values of a hash. |
| HINCRBY | Hash | O(1) | Compatible | Increment the integer value of a hash field. |
| HKEYS | Hash | O(N) fields | Compatible | Return all field names of a hash. |
| HLEN | Hash | O(1) | Compatible | Return the number of fields in a hash. |
| HMGET | Hash | O(M) fields requested | Compatible | Return the values of multiple hash fields. |
| HMSET | Hash | O(M) pairs | Compatible | Deprecated alias of HSET that replies OK. |
| HPERSIST | Hash | O(F) fields | Differs | Remove per-field TTLs from a hash. |
| HPEXPIRE | Hash | O(F) fields | Differs | Set per-field TTLs on a hash, in milliseconds. |
| HPEXPIREAT | Hash | O(F) fields | Differs | Set per-field expiries as absolute Unix-millisecond deadlines. |
| HPTTL | Hash | O(F) fields | Differs | Return per-field remaining TTLs in milliseconds (-1 no TTL, -2 missing). |
| HSCAN | Hash | O(N) | Differs | Iterate a hash's fields and values (single-batch cursor). |
| HSET | Hash | O(M) pairs | Compatible | Set one or more hash fields; returns the number of new fields. |
| HSETNX | Hash | O(1) | Compatible | Set a hash field only if it does not exist. |
| HTTL | Hash | O(F) fields | Differs | Return per-field remaining TTLs in seconds (-1 no TTL, -2 missing). |
| HVALS | Hash | O(N) fields | Compatible | Return all values of a hash. |
| SADD | Set | O(M) members | Compatible | Add one or more members to a set. |
| SCARD | Set | O(1) | Compatible | Return the number of members in a set. |
| SDIFF | Set | O(sum of the source cardinalities) | Compatible | Return the difference of the given sets (cross-shard gather). |
| SDIFFSTORE | Set | O(sum of the source cardinalities) + O… | Compatible | Store the difference of the given sets into destination. |
| SINTER | Set | O(sum of the source cardinalities) | Compatible | Return the intersection of the given sets (cross-shard gather). |
| SINTERSTORE | Set | O(sum of the source cardinalities) + O… | Compatible | Store the intersection of the given sets into destination. |
| SISMEMBER | Set | O(1) | Compatible | Check whether a value is a member of a set. |
| SMEMBERS | Set | O(N) members | Compatible | Return all members of a set. |
| SPOP | Set | O(count) expected | Differs | Remove and return one or more random members of a set. |
| SRANDMEMBER | Set | O(count) expected | Differs | Return one or more random members of a set without removing them. |
| SREM | Set | O(M) members | Compatible | Remove one or more members from a set. |
| SSCAN | Set | O(N) | Differs | Iterate a set's members (single-batch cursor). |
| SUNION | Set | O(sum of the source cardinalities) | Compatible | Return the union of the given sets (cross-shard gather). |
| SUNIONSTORE | Set | O(sum of the source cardinalities) + O… | Compatible | Store the union of the given sets into destination. |
| BZPOPMIN | Sorted set | O(log N) per pop | Compatible | Blocking pop of the lowest-scored member across one or more sorted sets. |
| ZADD | Sorted set | O(M log N) | Compatible | Add members with scores to a sorted set, with conditional flags. |
| ZCARD | Sorted set | O(1) | Compatible | Return the number of members in a sorted set. |
| ZCOUNT | Sorted set | O(N) | Compatible | Count members with scores within the given bounds. |
| ZDIFFSTORE | Sorted set | O(sum of the source cardinalities + R… | Compatible | Store the difference of the given sorted sets into destination. |
| ZINCRBY | Sorted set | O(log N) | Compatible | Increment a member's score in a sorted set. |
| ZINTERCARD | Sorted set | O(sum of the source cardinalities) | Compatible | Return the cardinality of the intersection of the given sorted sets. |
| ZINTERSTORE | Sorted set | O(sum of the source cardinalities + R… | Compatible | Store the intersection of the given sorted sets into destination. |
| ZPOPMIN | Sorted set | O(M log N) | Compatible | Pop up to count members with the lowest scores. |
| ZPOPMIN.BELOW | Sorted set | O(M log N) | kevy only | kevy extension: pop up to count lowest members with score strictly below the threshold (delayed-job primitive). |
| ZRANGE | Sorted set | O(start + M) | Differs | Return members by rank range. |
| ZRANGEBYSCORE | Sorted set | O(N + M) | Compatible | Return members with scores within the given bounds. |
| ZRANK | Sorted set | O(N) | Differs | Return a member's rank, ordered from the lowest score. |
| ZREM | Sorted set | O(M log N) | Compatible | Remove one or more members from a sorted set. |
| ZREMRANGEBYRANK | Sorted set | O(start + M log N) | Compatible | Remove members within the given rank range. |
| ZREMRANGEBYSCORE | Sorted set | O(N + M log N) | Compatible | Remove members with scores within the given bounds. |
| ZREVRANGEBYSCORE | Sorted set | O(N + M) | Compatible | Return members with scores within the given bounds, highest first. |
| ZSCAN | Sorted set | O(N) | Differs | Iterate a sorted set's members and scores (single-batch cursor). |
| ZSCORE | Sorted set | O(1) | Compatible | Return a member's score. |
| ZUNIONSTORE | Sorted set | O(sum of the source cardinalities + R… | Compatible | Store the union of the given sorted sets into destination. |
| XACK | Stream | O(A log P) | Compatible | Acknowledge pending entries for a consumer group. |
| XADD | Stream | O(log N) to insert | Differs | Append an entry to a stream, with optional trim. |
| XAUTOCLAIM | Stream | O(log P + K + COUNT log N) | Differs | Scan and claim idle pending entries starting from a cursor. |
| XCLAIM | Stream | O(A * (log P + log N)) | Differs | Claim specific idle pending entries for a consumer. |
| XDEL | Stream | O(D log N + N*F) for D ids | Compatible | Delete entries from a stream by ID. |
| XGROUP | Stream | CREATE / DESTROY: O(1) plus an O(N*F)… | Differs | Manage stream consumer groups. |
| XINFO | Stream | STREAM: O(1). GROUPS: O(G*N) | Differs | Introspect a stream, its groups, or its consumers. |
| XLEN | Stream | O(1) | Compatible | Return the number of entries in a stream. |
| XPENDING | Stream | summary: O(P*C) | Compatible | Inspect pending entries of a consumer group (summary or extended form). |
| XRANGE | Stream | O(log N + M) | Compatible | Return stream entries within an ID range. |
| XREAD | Stream | O(S * (log N + M)) over S streams | Differs | Read new entries from one or more streams, optionally blocking. |
| XREADGROUP | Stream | '>' form: O(log N + U + M) | Differs | Read stream entries as a consumer-group member, optionally blocking. |
| XREVRANGE | Stream | O(log N + M) | Compatible | Return stream entries within an ID range, in reverse order. |
| XSETID | Stream | O(log N) | Compatible | Overwrite a stream's last-generated ID and bookkeeping counters. |
| XTRIM | Stream | O(R log N + N*F) for R evicted entries | Differs | Trim a stream by length or minimum ID. |
| GEOADD | Geo | O(M log N) | Compatible | Add geospatial members (longitude/latitude) to a geo set. |
| GEODIST | Geo | O(1) | Compatible | Return the distance between two geo members. |
| GEOHASH | Geo | O(M) | Compatible | Return the base32 geohash string of each member. |
| GEOPOS | Geo | O(M) | Compatible | Return the longitude/latitude of each member. |
| GEORADIUS | Geo | O(N) per call | Differs | Legacy radius search around a coordinate, with optional STORE writes. |
| GEORADIUSBYMEMBER | Geo | O(N) per call | Differs | Legacy radius search around an existing member, with optional STORE writes. |
| GEOSEARCH | Geo | O(N) per call | Differs | Search members within a radius or box from a member or coordinate. |
| GEOSEARCHSTORE | Geo | O(N) to search, plus O(D + K log K) to… | Differs | Run GEOSEARCH on source and store the hits into destination. |
| ECHO | Connection | O(1) | Compatible | Return the given message. |
| HELLO | Connection | O(1) | Differs | Handshake: report server info and switch RESP protocol version (2 or 3). |
| PING | Connection | O(1) | Differs | Ping the server; returns PONG or echoes the optional message. |
| QUIT | Connection | O(1) | Compatible | Close the connection after replying OK. |
| SELECT | Connection | O(1) | Differs | Select the logical database; kevy is single-DB and only accepts index 0. |
| BGREWRITEAOF | Server | O(S) fan-out | Differs | Start an append-only-file rewrite in the background. |
| BGSAVE | Server | O(S) fan-out | Differs | Start a snapshot save in the background. |
| CLIENT | Server | ID / GETNAME / SETNAME / INFO: O(1). L… | Differs | Connection introspection and control subcommands. |
| CLUSTER | Server | INFO / NODES / SLOTS / SHARDS / MYID:… | Differs | Cluster topology introspection (virtual-node model over shards). |
| COMMAND | Server | bare / LIST / DOCS: O(V) verbs. COUNT:… | Differs | Introspect the command table (COUNT, LIST, INFO, DOCS subcommands). |
| CONFIG | Server | GET: O(patterns * 16). SET: O(1) plus… | Differs | Read or change server configuration parameters. |
| DBSIZE | Server | O(S) | Compatible | Return the number of keys across all shards. |
| DEBUG | Server | SLEEP: parks the ANSWERING shard's rea… | Differs | Debug subcommands; SLEEP blocks the shard, other subcommands are tolerated as OK. |
| FLUSHALL | Server | O(S) fan-out | Differs | Delete every key on every shard. |
| FLUSHDB | Server | O(N + S) | Differs | Delete every key of the current database (kevy is single-DB: same as FLUSHALL). |
| INFO | Server | O(1) in the keyspace | Differs | Report server statistics and status sections as text. |
| MEMORY | Server | USAGE: O(1) | Differs | Memory introspection subcommands. |
| SAVE | Server | O(S) fan-out | Differs | Synchronously snapshot the dataset to disk. |
| SHUTDOWN | Server | O(1) to trip the stop flag | Differs | Stop the server process (connection drops without a reply). |
| SLOWLOG | Server | GET: O(S) fan-out plus O(L log L) to m… | Differs | Inspect or reset the slow-command log. |
| DISCARD | Transactions | O(1) | Compatible | Abort the open MULTI transaction. |
| EXEC | Transactions | O(sum of the queued commands' costs) | Differs | Execute every command queued since MULTI. |
| MULTI | Transactions | O(1) | Compatible | Start a transaction; subsequent commands are queued until EXEC. |
| UNWATCH | Transactions | O(1) | Compatible | Forget all watched keys. |
| WATCH | Transactions | O(W) keys, grouped into O(min(W,S)) cr… | Compatible | Watch keys for optimistic locking of the next EXEC. |
| EVAL | Scripting | O(compile + the script's own work). Th… | Differs | Run a Lua script server-side; routed to KEYS[1]'s shard when numkeys >= 1. |
| EVALSHA | Scripting | O(1) cache lookup, then identical to E… | Differs | Run a cached Lua script by its SHA1 digest. |
| SCRIPT | Scripting | LOAD: O(len(script)). EXISTS: O(k). FL… | Differs | Manage the process-wide Lua script cache. |
| PSUBSCRIBE | Pub/Sub | O(p * P) | Compatible | Subscribe to channels matching the given glob patterns. |
| PUBLISH | Pub/Sub | O(1) channel lookup + O(P) | Compatible | Post a message to a channel; returns the receiver count. |
| PUNSUBSCRIBE | Pub/Sub | O(p * P) | Compatible | Unsubscribe from patterns (all patterns when none given). |
| SUBSCRIBE | Pub/Sub | O(c) channels | Differs | Subscribe to the given channels. |
| UNSUBSCRIBE | Pub/Sub | O(c) channels | Compatible | Unsubscribe from channels (all channels when none given). |
| FAILOVER | Replication | O(1) at the command | Differs | Planned zero-loss handover: quiesce writes, wait for the target replica to drain, promote it, and follow it. |
| REPL.TOKEN | Replication | O(S) | kevy only | kevy extension: mint a read-your-writes token — per-shard [generation, offset] pairs (a primary reports its live feed tail; a replica its applied positions). |
| REPL.WAIT | Replication | O(S) | kevy only | kevy extension: on a replica, block until every shard has applied the given REPL.TOKEN (then reads are read-your-writes); +OK on success, -MISDIRECTED writer is <primary> on timeout or generation mismatch. Default TIMEOUT 1000 ms, hard cap 60 s. On a primary: immediate +OK. |
| REPLICAOF | Replication | O(1) at the command | Differs | Make this server a replica of another, or promote it with NO ONE. |
| ROLE | Replication | O(1) on a replica | Compatible | Report the replication role and state of this server. |
| SLAVEOF | Replication | O(1) plus a background resync | Differs | Legacy alias of REPLICAOF. |
| WAIT | Replication | O(S) | Differs | Block until every shard's master_repl_offset is acknowledged by at least numreplicas replicas (or timeout ms pass); returns the minimum acked-replica count across shards. timeout 0 = wait forever, hard-capped at 60 s. NOTE: a replica ACK is not fsync durability. |
| IDX.COUNT | Indexes | O(log N + matched) per shard | kevy only | Count index entries matching a range or equality predicate. |
| IDX.CREATE | Indexes | O(1) at the call | kevy only | Declare a secondary index over a key prefix (catalog mutation, sidecar-persisted). |
| IDX.DROP | Indexes | O(catalog size) | kevy only | Drop a declared index (catalog mutation, sidecar-persisted). |
| IDX.EXPLAIN | Indexes | The plan is parse-only, but est_rows c… | kevy only | The IDX.QUERY parse without the execution: kind, state, est_rows, and the plan line. |
| IDX.LIST | Indexes | Not O(1) | kevy only | List declared indexes with per-index build state and stats. |
| IDX.QUERY | Indexes | Depends on the index kind. range: O(lo… | kevy only | Query an index: range/equality, text MATCH, vector KNN, aggregation groups, or a two-index COMPOSE. |
| IDX.REBUILD | Indexes | Vector indexes only (tombstone compact… | kevy only | Rebuild an ANN index (tombstone compaction). |
| IDX.VERIFY | Indexes | O(N) per shard | kevy only | Verify an index: re-read every held entry against its row and report entries/bytes/coerce_failures/duplicates/drift/checked. |
| VIEW.CREATE | Views | O(tree size) at the call. A materializ… | kevy only | Declare a composed view over indexes with an ORDER BY (catalog mutation, sidecar-persisted). |
| VIEW.DROP | Views | O(catalog size) | kevy only | Drop a declared view (catalog mutation, sidecar-persisted). |
| VIEW.EXPLAIN | Views | O(sum over leaves of (log N + matched)) | kevy only | Explain a view's composition tree with per-leaf cardinalities. |
| VIEW.LIST | Views | O(views) at the origin | kevy only | List declared views with their mode and shape. |
| VIEW.QUERY | Views | virtual: O(log N_order + candidates *… | kevy only | Page through a view's ordered members, optionally hydrating fields via the VIA template. |
| VIEW.REBUILD | Views | Materialized only. A full eval_tree ov… | kevy only | Force a rebuild of a materialized view. |
| VIEW.VERIFY | Views | materialized: O(M). virtual: O(sum ove… | kevy only | Verify a view and report member/byte statistics. |
| FEED.READ | Change feed | A single shard (the shard is an argume… | kevy only | Read change-feed frames from one shard past a generation/offset cursor. |
| FEED.SHARDS | Change feed | O(1), answered locally | kevy only | Return the number of change-feed shards. |
| FEED.TAIL | Change feed | O(1) on a single shard | kevy only | Return a shard's current feed generation and next offset. |
| PREFIX.DIGEST | Migration | O(keys on the shard) to walk plus O(su… | kevy only | Order-insensitive checksum of a prefix's rows for migration verification. |
| PREFIX.STATS | Migration | O(keys on the shard) | kevy only | Report key-count and byte statistics for a key prefix. |