I'm trying to import data from a MySQL database to Neo4j, using CSV files as an intermediary. I'm following the basic example, but can't quite get it to work. I'm importing two tables with these queries:
//Import projects.
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:/tmp/projects.csv" AS row
CREATE (:project
{
project_id: row.fan,
project_name: row.project_name
});
//Import people.
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:/tmp/persons.csv" AS row
CREATE (:person
{
person_id: row.person_id,
person_name: row.person_name,
});
//Create indicies.
CREATE INDEX ON :project(project_id);
CREATE INDEX ON :project(project_name);
CREATE INDEX ON :person(person_id);
CREATE INDEX ON :person(person_name);
This part works. What doesn't work is when I try to import the relations:
//Create project-person relationships.
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:/tmp/project_persons.csv" AS row
MATCH (project:project {project_id: row.project_id})
MATCH (person:person {person_id: row.person_id})
MERGE (person)-[:CONTRIBUTED]->(project);
The console accepts the query without an error, but never finishes. It's been running for days at 100% CPU, 25% RAM, but negligible disk usage. No relations appear in the database information.
Did I make a mistake somewhere, or is it really this slow? The project_persons.csv file is 13 million lines long, but shouldn't the periodic commit make something show up by now?