kevy4.0

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.

CommandsGroup ComplexityRedis compatibility Summary
APPENDStringO(1) amortised while the value is <= 6…CompatibleAppend bytes to a string value; returns the new length.
DECRStringO(1)CompatibleDecrement the integer value of a key by one.
DECRBYStringO(1)CompatibleDecrement the integer value of a key by the given amount.
GETStringO(1)CompatibleReturn the string value of a key.
GETDELStringO(1)CompatibleReturn the string value of a key and delete it.
GETSETStringO(1)CompatibleSet a key's string value and return its previous value.
INCRStringO(1)CompatibleIncrement the integer value of a key by one.
INCRBYStringO(1)CompatibleIncrement the integer value of a key by the given amount.
INCRBYFLOATStringO(1)DiffersIncrement the float value of a key by the given amount.
MGETStringO(N) keys, one O(1) probe each on the…DiffersReturn the values of multiple keys (cross-shard gather).
MSETStringO(N) pairs, one O(1) SET eachDiffersSet multiple key/value pairs atomically per shard.
PSETEXStringO(1)CompatibleSet a key's value with a TTL in milliseconds.
SETStringO(1)DiffersSet a key's string value with optional TTL and existence conditions.
SETEXStringO(1)CompatibleSet a key's value with a TTL in seconds.
SETNXStringO(1)CompatibleSet a key's value only if it does not exist.
STRLENStringO(1)CompatibleReturn the length of a key's string value.
DELGenericO(N) keys, plus O(M) per key holding a…DiffersDelete one or more keys.
EXISTSGenericO(N) keys, one O(1) probe eachDiffersCount how many of the given keys exist.
EXPIREGenericO(1)DiffersSet a key's TTL in seconds (non-positive TTL deletes the key).
EXPIREATGenericO(1)DiffersSet a key's expiry as an absolute Unix timestamp in seconds.
PERSISTGenericO(1)CompatibleRemove a key's TTL.
PEXPIREGenericO(1)DiffersSet a key's TTL in milliseconds.
PEXPIREATGenericO(1)DiffersSet a key's expiry as an absolute Unix timestamp in milliseconds.
PTTLGenericO(1)CompatibleReturn a key's remaining TTL in milliseconds (-1 no TTL, -2 missing).
RENAMEGenericO(1) for a string valueDiffersRename a key, overwriting the destination (write routed at the runtime Op level).
RENAMENXGenericO(1) for a string valueDiffersRename a key only if the destination does not exist (write routed at the runtime Op level).
TTLGenericO(1)CompatibleReturn a key's remaining TTL in seconds (-1 no TTL, -2 missing).
TYPEGenericO(1)CompatibleReturn the type of the value stored at key.
UNLINKGenericO(N) keys, plus O(M) per collection-ty…DiffersDelete one or more keys (alias of DEL in kevy's shard model).
KEYSKeyspace scanO(N) keys in the whole keyspaceCompatibleReturn every key matching the glob pattern (cross-shard gather).
RANDOMKEYKeyspace scanO(1) expectedDiffersReturn a random key from the keyspace.
SCANKeyspace scanO(N) keys in the WHOLE keyspace, on ev…DiffersSweep 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).
BLPOPListO(1) to serveDiffersBlocking left pop across one or more lists (effect logged as LPOP).
BRPOPListO(1) to serveDiffersBlocking right pop across one or more lists (effect logged as RPOP).
BRPOPLPUSHListO(1) to serveDiffersBlocking RPOPLPUSH: pop the source tail and push it onto the destination head.
LINDEXListO(1)CompatibleReturn the element at the given list index.
LLENListO(1)CompatibleReturn the length of a list.
LMOVEListO(1)DiffersAtomically move an element between two lists.
LPOPListO(C) elements poppedDiffersPop one or more elements from the head of a list.
LPOSListO(N) alwaysCompatibleReturn the index of matching elements in a list.
LPUSHListO(M) values, O(1) amortised eachCompatiblePrepend one or more elements to a list.
LRANGEListO(M) elements returnedCompatibleReturn a range of list elements.
LREMListO(N*R) worst caseCompatibleRemove elements equal to the given value from a list.
LSETListO(1)CompatibleSet the list element at the given index.
LTRIMListO(R) elements removedCompatibleTrim a list to the given range.
RPOPListO(C) elements poppedDiffersPop one or more elements from the tail of a list.
RPOPLPUSHListO(1)DiffersPop the source tail and push it onto the destination head.
RPUSHListO(M) values, O(1) amortised eachCompatibleAppend one or more elements to a list.
HDELHashO(M) fieldsCompatibleDelete one or more hash fields.
HEXISTSHashO(1)CompatibleCheck whether a hash field exists.
HEXPIREHashO(F) fields in the FIELDS clauseDiffersSet per-field TTLs on a hash, in seconds.
HGETHashO(1)CompatibleReturn the value of a hash field.
HGETALLHashO(N) fields, with a full copy of every…CompatibleReturn all fields and values of a hash.
HINCRBYHashO(1)CompatibleIncrement the integer value of a hash field.
HKEYSHashO(N) fieldsCompatibleReturn all field names of a hash.
HLENHashO(1)CompatibleReturn the number of fields in a hash.
HMGETHashO(M) fields requestedCompatibleReturn the values of multiple hash fields.
HMSETHashO(M) pairsCompatibleDeprecated alias of HSET that replies OK.
HPERSISTHashO(F) fieldsDiffersRemove per-field TTLs from a hash.
HPEXPIREHashO(F) fieldsDiffersSet per-field TTLs on a hash, in milliseconds.
HPEXPIREATHashO(F) fieldsDiffersSet per-field expiries as absolute Unix-millisecond deadlines.
HPTTLHashO(F) fieldsDiffersReturn per-field remaining TTLs in milliseconds (-1 no TTL, -2 missing).
HSCANHashO(N)DiffersIterate a hash's fields and values (single-batch cursor).
HSETHashO(M) pairsCompatibleSet one or more hash fields; returns the number of new fields.
HSETNXHashO(1)CompatibleSet a hash field only if it does not exist.
HTTLHashO(F) fieldsDiffersReturn per-field remaining TTLs in seconds (-1 no TTL, -2 missing).
HVALSHashO(N) fieldsCompatibleReturn all values of a hash.
SADDSetO(M) membersCompatibleAdd one or more members to a set.
SCARDSetO(1)CompatibleReturn the number of members in a set.
SDIFFSetO(sum of the source cardinalities)CompatibleReturn the difference of the given sets (cross-shard gather).
SDIFFSTORESetO(sum of the source cardinalities) + O…CompatibleStore the difference of the given sets into destination.
SINTERSetO(sum of the source cardinalities)CompatibleReturn the intersection of the given sets (cross-shard gather).
SINTERSTORESetO(sum of the source cardinalities) + O…CompatibleStore the intersection of the given sets into destination.
SISMEMBERSetO(1)CompatibleCheck whether a value is a member of a set.
SMEMBERSSetO(N) membersCompatibleReturn all members of a set.
SPOPSetO(count) expectedDiffersRemove and return one or more random members of a set.
SRANDMEMBERSetO(count) expectedDiffersReturn one or more random members of a set without removing them.
SREMSetO(M) membersCompatibleRemove one or more members from a set.
SSCANSetO(N)DiffersIterate a set's members (single-batch cursor).
SUNIONSetO(sum of the source cardinalities)CompatibleReturn the union of the given sets (cross-shard gather).
SUNIONSTORESetO(sum of the source cardinalities) + O…CompatibleStore the union of the given sets into destination.
BZPOPMINSorted setO(log N) per popCompatibleBlocking pop of the lowest-scored member across one or more sorted sets.
ZADDSorted setO(M log N)CompatibleAdd members with scores to a sorted set, with conditional flags.
ZCARDSorted setO(1)CompatibleReturn the number of members in a sorted set.
ZCOUNTSorted setO(N)CompatibleCount members with scores within the given bounds.
ZDIFFSTORESorted setO(sum of the source cardinalities + R…CompatibleStore the difference of the given sorted sets into destination.
ZINCRBYSorted setO(log N)CompatibleIncrement a member's score in a sorted set.
ZINTERCARDSorted setO(sum of the source cardinalities)CompatibleReturn the cardinality of the intersection of the given sorted sets.
ZINTERSTORESorted setO(sum of the source cardinalities + R…CompatibleStore the intersection of the given sorted sets into destination.
ZPOPMINSorted setO(M log N)CompatiblePop up to count members with the lowest scores.
ZPOPMIN.BELOWSorted setO(M log N)kevy onlykevy extension: pop up to count lowest members with score strictly below the threshold (delayed-job primitive).
ZRANGESorted setO(start + M)DiffersReturn members by rank range.
ZRANGEBYSCORESorted setO(N + M)CompatibleReturn members with scores within the given bounds.
ZRANKSorted setO(N)DiffersReturn a member's rank, ordered from the lowest score.
ZREMSorted setO(M log N)CompatibleRemove one or more members from a sorted set.
ZREMRANGEBYRANKSorted setO(start + M log N)CompatibleRemove members within the given rank range.
ZREMRANGEBYSCORESorted setO(N + M log N)CompatibleRemove members with scores within the given bounds.
ZREVRANGEBYSCORESorted setO(N + M)CompatibleReturn members with scores within the given bounds, highest first.
ZSCANSorted setO(N)DiffersIterate a sorted set's members and scores (single-batch cursor).
ZSCORESorted setO(1)CompatibleReturn a member's score.
ZUNIONSTORESorted setO(sum of the source cardinalities + R…CompatibleStore the union of the given sorted sets into destination.
XACKStreamO(A log P)CompatibleAcknowledge pending entries for a consumer group.
XADDStreamO(log N) to insertDiffersAppend an entry to a stream, with optional trim.
XAUTOCLAIMStreamO(log P + K + COUNT log N)DiffersScan and claim idle pending entries starting from a cursor.
XCLAIMStreamO(A * (log P + log N))DiffersClaim specific idle pending entries for a consumer.
XDELStreamO(D log N + N*F) for D idsCompatibleDelete entries from a stream by ID.
XGROUPStreamCREATE / DESTROY: O(1) plus an O(N*F)…DiffersManage stream consumer groups.
XINFOStreamSTREAM: O(1). GROUPS: O(G*N)DiffersIntrospect a stream, its groups, or its consumers.
XLENStreamO(1)CompatibleReturn the number of entries in a stream.
XPENDINGStreamsummary: O(P*C)CompatibleInspect pending entries of a consumer group (summary or extended form).
XRANGEStreamO(log N + M)CompatibleReturn stream entries within an ID range.
XREADStreamO(S * (log N + M)) over S streamsDiffersRead new entries from one or more streams, optionally blocking.
XREADGROUPStream'>' form: O(log N + U + M)DiffersRead stream entries as a consumer-group member, optionally blocking.
XREVRANGEStreamO(log N + M)CompatibleReturn stream entries within an ID range, in reverse order.
XSETIDStreamO(log N)CompatibleOverwrite a stream's last-generated ID and bookkeeping counters.
XTRIMStreamO(R log N + N*F) for R evicted entriesDiffersTrim a stream by length or minimum ID.
GEOADDGeoO(M log N)CompatibleAdd geospatial members (longitude/latitude) to a geo set.
GEODISTGeoO(1)CompatibleReturn the distance between two geo members.
GEOHASHGeoO(M)CompatibleReturn the base32 geohash string of each member.
GEOPOSGeoO(M)CompatibleReturn the longitude/latitude of each member.
GEORADIUSGeoO(N) per callDiffersLegacy radius search around a coordinate, with optional STORE writes.
GEORADIUSBYMEMBERGeoO(N) per callDiffersLegacy radius search around an existing member, with optional STORE writes.
GEOSEARCHGeoO(N) per callDiffersSearch members within a radius or box from a member or coordinate.
GEOSEARCHSTOREGeoO(N) to search, plus O(D + K log K) to…DiffersRun GEOSEARCH on source and store the hits into destination.
ECHOConnectionO(1)CompatibleReturn the given message.
HELLOConnectionO(1)DiffersHandshake: report server info and switch RESP protocol version (2 or 3).
PINGConnectionO(1)DiffersPing the server; returns PONG or echoes the optional message.
QUITConnectionO(1)CompatibleClose the connection after replying OK.
SELECTConnectionO(1)DiffersSelect the logical database; kevy is single-DB and only accepts index 0.
BGREWRITEAOFServerO(S) fan-outDiffersStart an append-only-file rewrite in the background.
BGSAVEServerO(S) fan-outDiffersStart a snapshot save in the background.
CLIENTServerID / GETNAME / SETNAME / INFO: O(1). L…DiffersConnection introspection and control subcommands.
CLUSTERServerINFO / NODES / SLOTS / SHARDS / MYID:…DiffersCluster topology introspection (virtual-node model over shards).
COMMANDServerbare / LIST / DOCS: O(V) verbs. COUNT:…DiffersIntrospect the command table (COUNT, LIST, INFO, DOCS subcommands).
CONFIGServerGET: O(patterns * 16). SET: O(1) plus…DiffersRead or change server configuration parameters.
DBSIZEServerO(S)CompatibleReturn the number of keys across all shards.
DEBUGServerSLEEP: parks the ANSWERING shard's rea…DiffersDebug subcommands; SLEEP blocks the shard, other subcommands are tolerated as OK.
FLUSHALLServerO(S) fan-outDiffersDelete every key on every shard.
FLUSHDBServerO(N + S)DiffersDelete every key of the current database (kevy is single-DB: same as FLUSHALL).
INFOServerO(1) in the keyspaceDiffersReport server statistics and status sections as text.
MEMORYServerUSAGE: O(1)DiffersMemory introspection subcommands.
SAVEServerO(S) fan-outDiffersSynchronously snapshot the dataset to disk.
SHUTDOWNServerO(1) to trip the stop flagDiffersStop the server process (connection drops without a reply).
SLOWLOGServerGET: O(S) fan-out plus O(L log L) to m…DiffersInspect or reset the slow-command log.
DISCARDTransactionsO(1)CompatibleAbort the open MULTI transaction.
EXECTransactionsO(sum of the queued commands' costs)DiffersExecute every command queued since MULTI.
MULTITransactionsO(1)CompatibleStart a transaction; subsequent commands are queued until EXEC.
UNWATCHTransactionsO(1)CompatibleForget all watched keys.
WATCHTransactionsO(W) keys, grouped into O(min(W,S)) cr…CompatibleWatch keys for optimistic locking of the next EXEC.
EVALScriptingO(compile + the script's own work). Th…DiffersRun a Lua script server-side; routed to KEYS[1]'s shard when numkeys >= 1.
EVALSHAScriptingO(1) cache lookup, then identical to E…DiffersRun a cached Lua script by its SHA1 digest.
SCRIPTScriptingLOAD: O(len(script)). EXISTS: O(k). FL…DiffersManage the process-wide Lua script cache.
PSUBSCRIBEPub/SubO(p * P)CompatibleSubscribe to channels matching the given glob patterns.
PUBLISHPub/SubO(1) channel lookup + O(P)CompatiblePost a message to a channel; returns the receiver count.
PUNSUBSCRIBEPub/SubO(p * P)CompatibleUnsubscribe from patterns (all patterns when none given).
SUBSCRIBEPub/SubO(c) channelsDiffersSubscribe to the given channels.
UNSUBSCRIBEPub/SubO(c) channelsCompatibleUnsubscribe from channels (all channels when none given).
FAILOVERReplicationO(1) at the commandDiffersPlanned zero-loss handover: quiesce writes, wait for the target replica to drain, promote it, and follow it.
REPL.TOKENReplicationO(S)kevy onlykevy 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.WAITReplicationO(S)kevy onlykevy 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.
REPLICAOFReplicationO(1) at the commandDiffersMake this server a replica of another, or promote it with NO ONE.
ROLEReplicationO(1) on a replicaCompatibleReport the replication role and state of this server.
SLAVEOFReplicationO(1) plus a background resyncDiffersLegacy alias of REPLICAOF.
WAITReplicationO(S)DiffersBlock 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.COUNTIndexesO(log N + matched) per shardkevy onlyCount index entries matching a range or equality predicate.
IDX.CREATEIndexesO(1) at the callkevy onlyDeclare a secondary index over a key prefix (catalog mutation, sidecar-persisted).
IDX.DROPIndexesO(catalog size)kevy onlyDrop a declared index (catalog mutation, sidecar-persisted).
IDX.EXPLAINIndexesThe plan is parse-only, but est_rows c…kevy onlyThe IDX.QUERY parse without the execution: kind, state, est_rows, and the plan line.
IDX.LISTIndexesNot O(1)kevy onlyList declared indexes with per-index build state and stats.
IDX.QUERYIndexesDepends on the index kind. range: O(lo…kevy onlyQuery an index: range/equality, text MATCH, vector KNN, aggregation groups, or a two-index COMPOSE.
IDX.REBUILDIndexesVector indexes only (tombstone compact…kevy onlyRebuild an ANN index (tombstone compaction).
IDX.VERIFYIndexesO(N) per shardkevy onlyVerify an index: re-read every held entry against its row and report entries/bytes/coerce_failures/duplicates/drift/checked.
VIEW.CREATEViewsO(tree size) at the call. A materializ…kevy onlyDeclare a composed view over indexes with an ORDER BY (catalog mutation, sidecar-persisted).
VIEW.DROPViewsO(catalog size)kevy onlyDrop a declared view (catalog mutation, sidecar-persisted).
VIEW.EXPLAINViewsO(sum over leaves of (log N + matched))kevy onlyExplain a view's composition tree with per-leaf cardinalities.
VIEW.LISTViewsO(views) at the originkevy onlyList declared views with their mode and shape.
VIEW.QUERYViewsvirtual: O(log N_order + candidates *…kevy onlyPage through a view's ordered members, optionally hydrating fields via the VIA template.
VIEW.REBUILDViewsMaterialized only. A full eval_tree ov…kevy onlyForce a rebuild of a materialized view.
VIEW.VERIFYViewsmaterialized: O(M). virtual: O(sum ove…kevy onlyVerify a view and report member/byte statistics.
FEED.READChange feedA single shard (the shard is an argume…kevy onlyRead change-feed frames from one shard past a generation/offset cursor.
FEED.SHARDSChange feedO(1), answered locallykevy onlyReturn the number of change-feed shards.
FEED.TAILChange feedO(1) on a single shardkevy onlyReturn a shard's current feed generation and next offset.
PREFIX.DIGESTMigrationO(keys on the shard) to walk plus O(su…kevy onlyOrder-insensitive checksum of a prefix's rows for migration verification.
PREFIX.STATSMigrationO(keys on the shard)kevy onlyReport key-count and byte statistics for a key prefix.