Create Link failure

11 views
Skip to first unread message

Andreas Dernbauer

unread,
Apr 15, 2015, 4:27:30 AM4/15/15
to ne...@googlegroups.com
I tried to connect to graphs by using a Bridge table

MATCH (a:dwhElement),(b:aifElement),(c:dwh2aif)
where a.ElementID = c.dwhElementID and c.aifElementID = b.ElementID  
CREATE (a)-[r:dwh_FEEDS_aif]->(b)
return r; 

After at least one hour I got as result uknown error,

MATCH (a:dwhElement)
return count(a);
returns 3842 rows

MATCH (a:aifElement)
return count(a);
returns 938 rows

MATCH (a:dwh2aif)
return count(a);
returns 2755 rows

MATCH (a:dwhElement),(b:dwh2aif)
where a.ElementID = b.dwhElementID
return count(a),count(b);
count(a) = 2755
count(b) = 2755

Any Ideas ? 

Thank you 

Andreas Dernbauer

unread,
Apr 15, 2015, 4:37:53 AM4/15/15
to ne...@googlegroups.com
If I run that query with access DB I got a result back in 1 second 
SELECT dwhElement.dwhSysID, dwhElement.dwhStructID, dwhElement.dwhElementName, aifElement.aifElememtID, aifElement.aifSysID, aifElement.aifStructID, aifElement.aifElementName
FROM (dwhElement INNER JOIN dwh2aif ON dwhElement.dwhElememtID = dwh2aif.dwhElementID) INNER JOIN aifElement ON dwh2aif.aifElementID = aifElement.aifElememtID;

Michael Hunger

unread,
Apr 15, 2015, 5:58:47 AM4/15/15
to ne...@googlegroups.com
I think you just create a cross product here. 3842* 938* 2755

try this

create index on :dwhElement(ElementID);
create index on :aifElement(ElementID);

MATCH (c:dwh2aif)
match (a:dwhElement)
where a.ElementID = c.dwhElementID
match (b:aifElement)
WHERE c.aifElementID = b.ElementID  
CREATE (a)-[r:dwh_FEEDS_aif]->(b)
return r; 

you can look at your query plan if you prefix your query with EXPLAIN or PROFILE (also runs it)

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andreas Dernbauer

unread,
Apr 15, 2015, 8:39:44 AM4/15/15
to ne...@googlegroups.com
Hi Michael 

Thank you for you answer, I created indexes of course without any success.

I tried explain but I got back

  • neo4j-sh (?)$ EXPLAIN match(a: dwhSystem) return a;
  • ==> Unknown command 'explain'
  • neo4j-sh (?)$ 

Michael Hunger

unread,
Apr 15, 2015, 9:11:53 AM4/15/15
to ne...@googlegroups.com
Which Neo4j version are you using? Explain is only in 2.2 ?

For previous versions use PROFILE.

M
Reply all
Reply to author
Forward
0 new messages