Skip to content

[Question] How to use string keys? #1

@ldionne

Description

@ldionne

The provided example uses keys that are integers. The associated loadKey function is:

void loadKey(TID tid, Key &key) {
    // Store the key of the tuple into the key vector
    // Implementation is database specific
    key.setKeyLen(sizeof(tid));
    reinterpret_cast<uint64_t *>(&key[0])[0] = __builtin_bswap64(tid);
}

And insertion goes like:

Key key;
loadKey(tid, key);
tree.insert(key, tid, t);

However, it's unclear to me how I can use strings as the keys in the tree, because I need to load the key from a TID, which is just an integer. I've read the companion paper and I think I understand how TID can be used as a tagged pointer, but I don't see how that helps me much. Any guidance would be highly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions