Hi ,
I am trying to load a CSV file for relationships. I am using CSV load and it is very slow. I do not want to use import , because that requires a clean database and I already have data present. I am wondering if NEO4J ETL would be faster ?
I am running the following code as of now through the NEO4J browser
:auto USING PERIODIC COMMIT 10000 LOAD CSV WITH HEADERS FROM "file:///ACTIVE_INGREDIENTS_BY_COUNTRY_COUNTRY_MAPPING.csv" AS row
MATCH (ac:ActiveIngredientsByCountry {ACTIVE_INGREDIENT_BY_COUNTRY_ID: row.ACTIVE_INGREDIENT_BY_COUNTRY_ID}),(c:Country {COUNTRY_CODE : row.COUNTRY_CODE} )
create (ac)-[:ACTIVE_INGREDIENT_BY_COUNTRY_COUNTRY_ASSOCIATION]->(c)
It creates relationships between two kinds of entities ACTIVE_INGREDIENTS_BY_COUNTRY (contains about 400k nodes)
COUNTRY (contains about 3 nodes)
This query takes about 3 days and we need to make it faster. How can I do this in a database in which data is already present ?
Thanks,
Samik