Skip to content

Minimize the use of keys related to index operations #4

@WolfDan

Description

@WolfDan

Right now any data type index operation could face a duplicate key prefix which is quite inefficient

Let's take for example 2 record

user_a = %{name: "Artorias", deaths: 50}
user_b = %{name: "Chosen Undeath", deaths: 50}

the index result of the deaths record would looks like

("user", "deaths", 50, user_a_node_uid) = ''
("user", "deaths", 50, user_b_node_uid) = ''

As you can see we have repeated the prefix "node_name", "deaths", 50 which is quite long by itself, containing bit_string data as node_name, property_name and property_value, so this proposal is to change it this way

("user", "deaths", 50, random_id) = [user_a_node_uid, user_b_node_uid]

we use the random_id in order to "extend" the index, since FDB has a limitation on value size, so when it reach this size we split the index in order to add more uids into the result of the index

This way a single key prefix can contain a quite big amount of node uids

I don't think it will have any repercution, normally on any index you need to query them all in order to bring any query result

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockThis feature could be important to the project but is blocked due given reason

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions