[master < T1147 ] Improve NameToId mapper on set properties #1147
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
This PR adds caching of name id mapper for property creation. If
name_id_mapper
proves to be a deadlock in other queries, we can think about how to add caching per storage accessor level. Thread local caching forname_id_mapper
didn't yield so much better results.Short benchmark.
The following queries were executed:
FOREACH (i in range(0, 1000000) | CREATE (n:Label {id:i}));
CREATE INDEX ON :Label(id);
FOREACH (i IN range(0, 1000000 , 3) | MERGE (n:Label {id:i}) SET n += {prop2:"nmrtRnZQzm", prop3:"bielFtyXca", prop4:"AoCYiwqjuu", prop5:"GqyKUebYyi", prop6:"spdWPDdyiY", prop7:"dzpACFXOal", prop8:"NchfJxgMHL", prop9:"JKbOEGOhkl", prop10:"ftmaTyKESy", prop11:"cIgjUrbHcF"});
Execution for last query:
[master < Task] PR
To keep docs changelog up to date, one more thing to do: