简体   繁体   中英

Limit of labels on a node in Neo4j

Is there a limit on the number of labels you can put on nodes in Neo4j? Also what are the ramifications of lots of labels on the performance of inserts? Thanks

In theory the number of labels is almost unlimited (not sure but I think it was Integer.MAX_VALUE). In practice you should have as few labels as reasonable on a single node. The first 4-5 (don't remember the exact number) labels are stored directly with the node. The remaining labels are stored in a different location internally. So reading a node having more than 4-5 labels might result in another IO operation.

Upon a write operation every labels will cause extra burden since labels are self-indexing and therefore Neo4j needs to write to the labelscanstore for that label.

Most graphs I've seen so far (and that's quire a few ;-) ) don't have more than 3 labels on a single node.

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