0

Is it good practice to use the same edge name on multiple places in Gremlin?

I have a situation where I can use has as an EDGE name b/w multiple vertecies. Is that ok ? or it's better to have a different name for the performance? For understanding, I guess, a different name/label is better. What about the performance?

Thirumal
  • 8,280
  • 11
  • 53
  • 103

1 Answers1

0

You really have to look for edge cases to get a notable impact on performance. An example: if you would do an index lookup on the combination of edge label and property key when an edge label was reused once, execution time would scale as log(2N) = log(N) + log(2). I consider this an edge case because starting a traversal on a relation is often considered an anti-pattern.

Personally, I like reuse of edge labels, but only if the semantics of the relation is exactly the same. Compare with the semantic web ontology language OWL, where you can define a domain and range for each relation. There, domain and range can consist of multiple vertex types.

HadoopMarc
  • 1,356
  • 3
  • 11