简体   繁体   中英

neo4j relationship type limit?

I've created my graph with 38,000 relationship types, essentially shifting information out of properties and onto the relationship type. I've done this because for my query speed, the .getProperties() functions was holding me back. But now when I attempt to run my query, I instead get this:

java.lang.NullPointerException
    at org.neo4j.kernel.impl.core.NodeManager.receiveRelationships(NodeManager.java:658)
    at org.neo4j.kernel.impl.core.NodeManager.getMoreRelationships(NodeManager.java:624)
    at org.neo4j.kernel.impl.core.NodeImpl.getMoreRelationships(NodeImpl.java:400)
    at org.neo4j.kernel.impl.core.NodeImpl.loadInitialRelationships(NodeImpl.java:352)
    at org.neo4j.kernel.impl.core.NodeImpl.ensureRelationshipMapNotNull(NodeImpl.java:338)
    at org.neo4j.kernel.impl.core.NodeImpl.getAllRelationshipsOfType(NodeImpl.java:184)
    at org.neo4j.kernel.impl.core.NodeImpl.getRelationships(NodeImpl.java:269)
    at org.neo4j.kernel.impl.core.NodeProxy.getRelationships(NodeProxy.java:114)

I'm assuming this is related to the large number of relationship types I have, as before expanding to 38,000, I didn't have any problems. Is there any way to remedy this? Is there a place where I can see the limitations of the Relationship Types for neo4j?

Yes that is probably right, see http://docs.neo4j.org/chunked/snapshot/capabilities-capacity.html#capabilities-data

Maybe raise an issue to extend it and your use case? How many do you need?

I believe storage wise the actual limit is 2^15-1 (=32767) types, not 2^16-1 (=65535). There seems to be some invalid checks, making for a weird exception being thrown from Neo4j.

Since you need at least 100k you would still hit a problem. Would be great with a configurable (at store creation) max number of relationship types supported, a setting that would affect the space each relationship will take on disk.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM