cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Difference between return map projection of all properties in a node and return the node itself?

Hi all,

I am trying to figure out exactly why there is a difference when returning in a node by itself vs returning all properties from a map projection.
Example:
a)

PROFILE MATCH (g:Group)
OPTIONAL MATCH (g)-[:GROUPS]->(u)
RETURN {group: g, user: collect(u)} AS data

vs

b)

PROFILE MATCH (g:Group)
OPTIONAL MATCH (g)-[:GROUPS]->(u)
RETURN g{.*, user: collect(u{.*})} AS data

I want to know why query (b) takes more memory & a longer execution time compared to query (a)?

Thanks in advance.

0 REPLIES 0