OBJECT ENCODING

Since 1.1.0Keys

Syntax

OBJECT ENCODING key

Returns the name of the encoding Redis would use for the value at key, from the value's size and the *-max-listpack-* and set-max-intset-entries settings.

KiviDB stores each type one way, whatever its size. The name is there for clients and tests that look at it.

TypeNames
stringint, embstr, raw
listlistpack, quicklist
setlistpack, intset, hashtable
hashlistpack, hashtable
sorted setlistpack, skiplist
streamstream

Examples

> SET a 123
OK
> OBJECT ENCODING a
"int"
> SET b hello
OK
> OBJECT ENCODING b
"embstr"