cancel
Showing results for 
Search instead for 
Did you mean: 

APOC parallelise a simple MATCH(n) RETURN n

anthino12
Node Clone

I have the simplest cypher ever:

MATCH(n)
RETURN n

But this cypher returns 1 million data and it takes too long (sometimes it doesn't even finish, the app just crashes). I read that I can use apoc.cypher.parallel for better performance but it throws an error and I can't use it. After running apoc.cypher.parallel("MATCH(n) RETURN n") I get the error:

Invalid input 'p': expected 'l/L' (line 1, column 2 (offset: 1))
"apoc.cypher.parallel("MATCH(n) RETURN n")"
  ^

Is there a way to fix this error or more importantly, is there a way to parallelise the query on the other way?

5 REPLIES 5

soham_dhodapka1
Node Clone

Hi @anthino12,
May I ask what is it that you want to achieve? MATCH (n) RETURN n is going to return all the data you have in your graph.

Correct. The data I'm trying to return is very big (approx. 1 million of nodes) and I can't return it. The app crashes so I assume that having it parallelised, I can have the data faster(?)

I see, and by app you mean Neo4j Browser?

Cobra
Ninja
Ninja

Hello @anthino12

I think there is a syntax error, you must add a CALL front of your cypher request:

CALL apoc.cypher.parallel("MATCH(n) RETURN n")

Regards,
Cobra

Hello @anthino12
Did you eventually find the solution for this?

Thanks,
Richard

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.