memgraph/tests/public_benchmark/ldbc/test_cases/queries/query_4.cyp
florijan 21550d3bb1 LDBC queries checked
Summary:
- checked existing queries and added new ones
- minor changes to LDBC setup

Reviewers: teon.banek, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D737
2017-09-02 10:36:02 +02:00

12 lines
519 B
Plaintext

MATCH (person:Person {id:"21990232559429"})-[:KNOWS]-(:Person)<-[:HAS_CREATOR]-(post:Post)-[:HAS_TAG]->(tag:Tag)
WHERE post.creationDate >= 1335830400000 AND post.creationDate < 1345830400000
OPTIONAL MATCH (tag)<-[:HAS_TAG]-(oldPost:Post)-[:HAS_CREATOR]->(:Person)-[:KNOWS]-(person)
WHERE oldPost.creationDate < 1335830400000
WITH tag, post, length(collect(oldPost)) AS oldPostCount
WHERE oldPostCount=0
RETURN
tag.name AS tagName,
length(collect(post)) AS postCount
ORDER BY postCount DESC, tagName ASC
LIMIT 10;