-
Notifications
You must be signed in to change notification settings - Fork 1
Minimize the use of keys related to index operations #4
Description
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