Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-26-2019 10:59 PM
Hello Team,
I need help in knowing how to run the MATCH MATCH MERGE query in periodic iterate.
Below is my query:
USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS FROM "file:///granite2csv_path_ONT_CKT.csv" as row
MATCH (n:SPLITTER2_IN_PORT {SPLITTER2_NAME: row.PATH_ASIDE_EQUIPMENT})
MATCH (m:SPLITTER2_OUT_PORT {SP2_OUT_PORT_NAME: row.PATH_ASIDE_PORT})',
MERGE (n)-[r:SP2_INPORT_2_SP2_OUTPORT]->(m)
return r
Please help!
Regards
Akshat
09-27-2019 04:17 AM
Hello Akshat,
Remove the comma after the second match. Returning the relationship is not very useful, but you can certainly do it,
Elaine
09-27-2019 04:22 AM
Hello Elaine,
Apologies for my mistake. , I forgot to remove that comma but in actual that comma is not present in my query. Hence I need to run the below query in periodic iterate.
Below query is taking too much time ( running from last 6 hours or elapsedTimeMillis = 20084612 ).
Please suggest better way to make this execution fast.
CSV contains 10 Lacs records.
USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS FROM "file:///granite2csv_path_ONT_CKT.csv" as row
MATCH (n:SPLITTER2_IN_PORT {SPLITTER2_NAME: row.PATH_ASIDE_EQUIPMENT})
MATCH (m:SPLITTER2_OUT_PORT {SP2_OUT_PORT_NAME: row.PATH_ASIDE_PORT})
MERGE (n)-[r:SP2_INPORT_2_SP2_OUTPORT]->(m)
return r
Best Regards
Akshat
10-03-2019 02:41 AM
Hello Team ,
Please suggest on above query asked!
Thanks
Regards
Akshat
10-03-2019 05:03 AM
We don't recommend returning anything when doing a load (especially with PERIODIC COMMIT), try removing the RETURN.
Also, make sure you have an index on :SPLITTER2_IN_PORT(SPLITTER2_NAME)
as well as on :SPLITTER2_OUT_PORT(SP2_OUT_PORT_NAME)
. You can double check using EXPLAIN to make sure you see two NodeIndexSeek operators and no NodeByLabelScan operators.
All the sessions of the conference are now available online