I'm doing some tests on redisgraph and I'm wondering what is the best practice to match nodes if I have a hierarchy like this:
category => post => comment => reply
I have index on each label _id field and I match according to the _id
First approach: by matching all the way to the target node:
GRAPH.QUERY test "MATCH (:category {_id:1})-[:post]->(:post {_id:1})-[comment_rel_1:comment]->(c1:comment {_id:1}) SET c1.comment = 'changed'"
Second approach: matching the node directly
GRAPH.QUERY test "MATCH (c1:comment {_id:1}) SET c1.comment = 'changed'"
In case of a huge database with a lot of nodes and edges what approach considered to be time efficient?
Thanks