Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neo4j precomputations #155

Open
szarnyasg opened this issue Dec 18, 2022 · 0 comments
Open

Neo4j precomputations #155

szarnyasg opened this issue Dec 18, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@szarnyasg
Copy link
Member

szarnyasg commented Dec 18, 2022

Neo4j could make use of some precomputations, e.g. adding a ROOT_POST edge for (:Comment)-[:REPLY_OF*]->(:Post).

This could speed up 6 queries:

$ ag -Q 'REPLY_OF*' queries
queries/bi-3.cypher
11:  (post:Post)<-[:REPLY_OF*0..]-(message:Message)-[:HAS_TAG]->(:Tag)-[:HAS_TYPE]->(:TagClass {name: $tagClass})

queries/bi-9.cypher
8:MATCH (person:Person)<-[:HAS_CREATOR]-(post:Post)<-[:REPLY_OF*0..]-(reply:Message)

queries/bi-4.cypher
17:  MATCH (topForum1)-[:CONTAINER_OF]->(post:Post)<-[:REPLY_OF*0..]-(message:Message)-[:HAS_CREATOR]->(person:Person)<-[:HAS_MEMBER]-(topForum2:Forum)

queries/bi-12.cypher
10:OPTIONAL MATCH (person)<-[:HAS_CREATOR]-(message:Message)-[:REPLY_OF*0..]->(post:Post)

queries/bi-15.cypher
23:      OPTIONAL MATCH (m1)-[:REPLY_OF*0..]->(:Post)<-[:CONTAINER_OF]-(forum:Forum)

queries/bi-17.cypher
11:  (person1:Person)<-[:HAS_CREATOR]-(message1:Message)-[:REPLY_OF*0..]->(post1:Post)<-[:CONTAINER_OF]-(forum1:Forum),
17:  (comment)-[:REPLY_OF]->(message2)-[:REPLY_OF*0..]->(post2:Post)<-[:CONTAINER_OF]-(forum2:Forum)
@szarnyasg szarnyasg added the enhancement New feature or request label Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant