Giter VIP home page Giter VIP logo

benchmarks's People

Contributors

inversefalcon avatar maxdemarzi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

inversefalcon

benchmarks's Issues

BusinessIntelligence-12

I thought I had this faster but this is 22seconds

match (message:Message)
WHERE message.creationDate > 20111021192109382
and
size((message)<-[:LIKES]-()) > 400
with message order by size((message)<-[:LIKES]-()) > 400 limit 100
match (message:Message)-[:HAS_CREATOR]->(creator:Person)
RETURN
message.id,
message.creationDate,
creator.firstName,
creator.lastName,
size((message)<-[:LIKES]-()) as likeCount
ORDER BY
likeCount DESC,
message.id ASC

BusinessIntelligence1

With index on :Message(creationDate), I was able to rewrite the query and get results in 110 seconds instead of 429

MATCH (message:Message)
WHERE message.creationDate < 20120501000000000
with toFloat(count(message)) as allMessages
match (message:Message)
WHERE message.creationDate < 20120501000000000
WITH allMessages, toFloat(count(message)) AS messageCount, message.creationDate/10000000000000 AS year, floor(avg(message.length)) AS averageMessageLength,message:Comment AS isComment,
sum(message.length) AS sumMessageLength,
CASE
WHEN message.length < 40 THEN 0
WHEN message.length < 80 THEN 1
WHEN message.length < 160 THEN 2
ELSE 3
END AS lengthCategory
return year, isComment, lengthCategory, messageCount, averageMessageLength, sumMessageLength, toFloat(messageCount/allMessages) as pctMessages;

BL-16

MATCH (p:Person {id: 19791209310731})
with p
call apoc.path.subgraphNodes(p, {maxLevel:5, relationshipFilter:'KNOWS'})
yield node
with distinct node as person
MATCH
(person)-[:IS_LOCATED_IN]->(:City)-[:IS_PART_OF]->(:Country {name: 'Pakistan'})
with distinct person
match
(person)<-[:HAS_CREATOR]-(message:Message)-[:HAS_TAG]->(tag:Tag)-[:HAS_TYPE]->
(:TagClass {name: 'MusicalArtist'})
RETURN
person.id,
tag.name,
count(DISTINCT message) AS messageCount
ORDER BY
messageCount DESC,
tag.name ASC,
person.id ASC
LIMIT 100

BL-17

MATCH (country:Country {name: 'Spain'})
with country
MATCH (a:Person)-[:IS_LOCATED_IN]->(:City)-[:IS_PART_OF]->(country)
with collect(distinct a) as aPrime
with aPrime, aPrime as bPrime
unwind aPrime as ap
with ap,bPrime
unwind bPrime as bp
MATCH (ap)-[:KNOWS]-(bp)
where ap.id < bp.id
with ap, bp
match (bp)-[:KNOWS]-(c) where c.id<ap.id
and (c)-[:IS_LOCATED_IN]->(:City)-[:IS_PART_OF]->(:Country {name: 'Spain'})
and (c)-[:KNOWS]-(ap)
RETURN count(*) AS count

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.