-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(backend): node_create_all duplicate AttributeValue rels
If there are duplicate AttributeValue nodes present (due to concurrent node creation for example), the MERGE statement would return more than one node. Thus the HAS_VALUE relationship would be created for all the nodes that have been returned. Due to that behavior, attribute retrieval is slower because more (duplicate) rows are returned in node_list_get_attribute. Fix this by using a LIMIT 1 statement right after MERGE. Using LIMIT 1 implies removing FOREACH statements which are not compatible with LIMIT (that implies WITH). Move to CALL subqueries instead to work that around. CALL subqueries do not work very well with UNWIND when the list is empty, make the whole query dynamic and remove parts when lists are empty to work that around. Signed-off-by: Fatih Acar <fatih@opsmill.com>
- Loading branch information
1 parent
eb60128
commit 2f2983d
Showing
3 changed files
with
70 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters