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

BusinessIntelligence-14 #21

Open
davidfauth opened this issue Jul 21, 2019 · 1 comment
Open

BusinessIntelligence-14 #21

davidfauth opened this issue Jul 21, 2019 · 1 comment

Comments

@davidfauth
Copy link

Added index on :Post(creationDate)

@maxdemarzi
Copy link
Owner

Without an index this is better as well.

MATCH (post:Post)
      WHERE  $endDate >= post.creationDate >= $startDate
      WITH post
      MATCH (post)<-[:REPLY_OF*0..]-(reply)
      WHERE $endDate >= reply.creationDate >= $startDate
      WITH post, reply
      MATCH (person)<-[:HAS_CREATOR]-(post)
      RETURN
        person.id,
        person.firstName,
        person.lastName,
        count(DISTINCT post) AS threadCount,
        count(DISTINCT reply) AS messageCount
      ORDER BY
        messageCount DESC,
        person.id ASC
      LIMIT 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants