OBJECT-ENCODING(3valkey)
π NAME π
ok so object-encoding β it tells you the internal encoding of an object. that's it, that's the whole vibe. β¨
π SYNOPSIS π
OBJECT ENCODING key
πΈ DESCRIPTION πΈ
bestie, this command hands you the internal encoding of the Valkey object chillin' at <key>. it's giving backstage pass energy. π
and ok, Valkey objects can be encoded all kinds of ways depending on what they are:
- Strings can be encoded as:
rawβ normal string encoding, the default girlie.intβ strings that represent integers in a 64-bit signed interval get encoded this way to save space. frugal queen. πembstrβ an embedded string, which is an object where the internal simple dynamic string,sds, is an unmodifiable string allocated in the same chuck as the object itself.embstrcan be strings with lengths up to the hardcoded limit ofOBJ_ENCODING_EMBSTR_SIZE_LIMITor44bytes.
- Lists can be encoded as:
linkedlistβ simple list encoding. No longer used, an old list encoding. she's retired fr fr. πlistpackβ a space-efficient encoding used for small lists.quicklistβ encoded as linked list of ziplists or listpacks.
- Sets can be encoded as:
hashtableβ normal set encoding.intsetβ a special encoding used for small sets composed solely of integers.listpackβ a space-efficient encoding used for small sets.
- Hashes can be encoded as:
zipmapβ no longer used, an old hash encoding. another icon from the past π°οΈhashtableβ normal hash encoding.listpackβ a space-efficient encoding used for small hashes.
- Sorted Sets can be encoded as:
skiplistβ normal sorted set encoding.listpackβ a space-efficient encoding used for small sorted sets.
- Streams can be encoded as:
streamβ encoded as a radix tree of listpacks.
β οΈ heads up babes: all the specially encoded types are automatically converted to the general type once you perform an operation that makes it impossible for Valkey to retain the space saving encoding. no takebacks, she grows up. π¦
β¨ REPLY β¨
π RESP2
one of the following, bestie:
valkey-protocol(7)Nil reply: if the key doesn't exist. πvalkey-protocol(7)Bulk string reply: the encoding of the object.
π RESP3
one of the following:
valkey-protocol(7)Null reply: if the key doesn't exist.valkey-protocol(7)Bulk string reply: the encoding of the object.
π§ COMPLEXITY π§
like, instant. no notes. β‘
π₯ ACL CATEGORIES π₯
@keyspace @read @slow
π¦ HISTORY π¦
- Available since:
2.2.3β she's been around, a true veteran π
π SEE ALSO π
copy(3valkey),del(3valkey),dump(3valkey),exists(3valkey),expire(3valkey),expireat(3valkey),expiretime(3valkey),keys(3valkey),migrate(3valkey),move(3valkey),object(3valkey),object-freq(3valkey),object-help(3valkey),object-idletime(3valkey),object-refcount(3valkey),persist(3valkey),pexpire(3valkey),pexpireat(3valkey),pexpiretime(3valkey),pttl(3valkey),randomkey(3valkey),rename(3valkey),renamenx(3valkey),restore(3valkey),scan(3valkey),sort(3valkey),sort_ro(3valkey),touch(3valkey),ttl(3valkey),type(3valkey),unlink(3valkey),wait(3valkey),waitaof(3valkey)
k that's the whole page bestie!! this was version 9.0.0, dropped on 2025-10-21, straight out of the OBJECT-ENCODING(3valkey) manual β go check your object's encoding, it's literally free and O(1), periodt π
β¨π«Ά
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms