Head's Up! Site migration is underway. Phase 1: replicate users.
β08-30-2022 09:14 AM
Welcome back to our Weekly challenge series!
In keeping with the theme so far, this week's challenge is to tune the provided query.
Here's what you need to do!
"PROFILE
MATCH (m:Movie)<-[:ACTED_IN]-(a:Person)
WITH m, collect(a.name) as actorNames
WHERE size(actorNames) <= $maxActors
RETURN m.title, m.year, actorNames"
Solutions submitted between 8/30 and 9/9 will be eligible for a Neo4j T-Shirt drawing!
Show us your ways to improve the query!
β08-30-2022 09:25 AM
Hello @TrevorS π
:param maxActors => 2;
MATCH (m:Movie)
WHERE 0 < size((m)<-[:ACTED_IN]-()) <= $maxActors
RETURN m.title, m.year, [(m)<-[:ACTED_IN]-(a) | a.name] AS actorNames;
Regards,
Cobra
β08-31-2022 12:23 AM - edited β08-31-2022 12:25 AM
size((m)<-[:ACTED_IN]-())
I don't think it's possible to beat that as suggested by @Cobra
β11-29-2022 09:25 PM
Best I could do was 20,050 db hits haha, I believe adding the "0 < " is unnecessary right? For size to return < 0 wouldn't be possible? And it adds processing time (and somehow db hits?) so below is very very very barely faster π hahah
All the sessions of the conference are now available online