OBJECT-ENCODING(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

πŸ’– 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. embstr can be strings with lengths up to the hardcoded limit of OBJ_ENCODING_EMBSTR_SIZE_LIMIT or 44 bytes.
  • 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:

πŸ’œ RESP3

one of the following:


🧚 COMPLEXITY 🧚

O(1)

like, instant. no notes. ⚑


πŸ”₯ ACL CATEGORIES πŸ”₯

@keyspace @read @slow


πŸ¦‹ HISTORY πŸ¦‹

  • Available since: 2.2.3 β€” she's been around, a true veteran πŸ’–

🌈 SEE ALSO 🌈


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