YCSB-cpp icon indicating copy to clipboard operation
YCSB-cpp copied to clipboard

How to disable the fixed prefix "user" for the key?

Open luchao2424631502 opened this issue 4 months ago • 1 comments

Key

The minimum key size is 5 bytes (4 bytes for "user" + 1 byte for single digit like "0"). Regarding key generation, it depends on the insertorder option:

ordered: Keys are generated sequentially starting from 1 (user1, user2, user3, ...) hashed: Keys use hashed 64-bit values for random distribution

You can also use the zeropadding option to fix the key length. For example, with zeropadding=20, keys would look like:

user0000000000000000001
user0000000000000000002
user1234567890123456789

This ensures all keys have the same 24-byte length.

Value

Here's what a typical record might look like:

Key: user1234567890
Value: field0=<100 bytes of data>, field1=<100 bytes of data>, ..., field9=<100 bytes of data>

Here, the field can be thought of as a column in SQL. However, since columns are not supported in key-value stores, they are encoded as follows.

Field Name Length: 32-bit length of field name
Field Name: field name ("field0", "field1", etc.)
Field Value Length : 32-bit length of field value
Field Value: actual field value

So field each is 114 bytes.

Originally posted by @ls4154 in #25 Hello author, now I want to remove the fixed prefix "user" from the key. How can I do that? I didn't see the relevant control parameters.

luchao2424631502 avatar Nov 24 '25 03:11 luchao2424631502

I've added keyprefix configuration. https://github.com/ls4154/YCSB-cpp/blob/master/PROPERTIES.md

ls4154 avatar Nov 26 '25 16:11 ls4154