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

BusinessIntelligence1 #22

Open
davidfauth opened this issue Jul 22, 2019 · 0 comments
Open

BusinessIntelligence1 #22

davidfauth opened this issue Jul 22, 2019 · 0 comments

Comments

@davidfauth
Copy link

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;

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

1 participant