I create some graph database with python and neo4j library. Graph have 50k nodes and 100k relationships.
How creating nodes:
CREATE (user:user {task_id: %s, id: %s, root: 1, private: 0})
How creating relationships:
MATCH (root_user), (friend_user) WHERE root_user.id = %s
AND root_user.task_id = %s
AND friend_user.id = %s
AND friend_user.task_id = %s
CREATE (root_user)-[r: FRIEND_OF]->(friend_user) RETURN root_user, friend_user
How i search all path between nodes:
MATCH (start_user:user {id: %s, task_id: %s}),
(end_user:user {id: %s, task_id: %s}),
path = allShortestPaths((start_user)-[*..3]-(end_user)) RETURN path
Soo its very slow, around 30-60 min on 50k graph. And i cant understand why. I try to create index like this:
CREATE INDEX ON :user(id, task_id)
but its not help. Can you help me? Thanks.