0

Due to some reasons, I have to first label a large amount of data, and then recalculate the data and re-label based on the new data within a certain period (such as one week). The query I use is as follows:

lookup on person yield id(vertex) as id | go from $-.id over related_tags where properties($$).tag_name == "male" yield id($^) as id | limit 0,10;

My graph structure is: (person)-[related_tags]->(tag), where the above statement queries people with the tag "male".

I found through testing, if I used an index to directly index the tag name, with a query speed of 0.1 seconds, and a query time of more than 40 seconds without indexing.

Then deleting the tag, I did not manually perform compaction, and recalculated the "male" tag and wrote it to the database using the labeling statement. In this way, our query speed reaches 50 seconds, even though the indexing time has not decreased.

What is the reason for the slow query speed? Is it because our approach of only deleting the tag is incorrect? Or is it because the index did not take effect after re-writing?

So what is the reason for this performance difference?

MarieS
  • 1

0 Answers0