You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the current implementation of UniquenessChecker (the class used to determine if any nodes violate the uniqueness constraints of a given schema) runs a single cypher query that entangles all uniqueness constraints. this can cause a performance bottleneck if one of the constraints being examined has a value that many existing nodes use. for example, in the case of IP addresses, they have a uniqueness constraint of [[ip_namespace, address__value]]. Many IP address nodes might be linked to the same IP namespace, but there will only be a few nodes with the same address value.
we should refactor the UniquenessChecker and its associated cypher query to filter for each element of a uniqueness
constraint group instead of trying to handle all of the uniqueness constraint elements simultaneously. this would allow schema to specify uniqueness constraint groups from most specific to least specific (eg [address__value, ip_namespace]). then the UniquenessChecker could use that ordering to avoid checking the 1000s of nodes that might be linked to a given IP namespace and start with the address__value filtering that would yield many fewer nodes
Describe the Use Case
improve performance of the uniqueness constraints, which we need to check every time a node is created or updated
Additional Information
might require internal migration to update uniqueness constraints on some of the base schema
The text was updated successfully, but these errors were encountered:
Component
API Server / GraphQL
Describe the Feature Request
the current implementation of
UniquenessChecker
(the class used to determine if any nodes violate the uniqueness constraints of a given schema) runs a single cypher query that entangles all uniqueness constraints. this can cause a performance bottleneck if one of the constraints being examined has a value that many existing nodes use. for example, in the case of IP addresses, they have a uniqueness constraint of[[ip_namespace, address__value]]
. Many IP address nodes might be linked to the same IP namespace, but there will only be a few nodes with the same address value.we should refactor the
UniquenessChecker
and its associated cypher query to filter for each element of a uniquenessconstraint group instead of trying to handle all of the uniqueness constraint elements simultaneously. this would allow schema to specify uniqueness constraint groups from most specific to least specific (eg
[address__value, ip_namespace]
). then theUniquenessChecker
could use that ordering to avoid checking the 1000s of nodes that might be linked to a given IP namespace and start with theaddress__value
filtering that would yield many fewer nodesDescribe the Use Case
improve performance of the uniqueness constraints, which we need to check every time a node is created or updated
Additional Information
might require internal migration to update uniqueness constraints on some of the base schema
The text was updated successfully, but these errors were encountered: