I want a list of all edge types from a set of one or more nodes. I have some existing queries like this:
g.v(ids.toArray()).outE.has("g_ts", T.gte, gts).has("g_te", T.lte, gte).label.dedup()
g.v(ids.toArray()).inE.has("g_ts", T.gte, gts).has("g_te", T.lte, gte).label.dedup()
They work for most nodes but when we get to a super node (many tens of thousands of edges) they fail or become very slow because of the outE.
We can replace these with something like this
l= m.E.gm_le.dedup.tolist()//list of all possible edge types
g.v(ids.toArray()).outE(l).has("g_ts", T.gte, gts).has("g_te", T.lte, gte).label.dedup
g.v(ids.toArray()).inE(l).has("g_ts", T.gte, gts).has("g_te", T.lte, gte).label.dedup
Which will use vertex indices, is quicker and will return on a super node (it is still a few seconds).
The questions are:
1. Can someone give a good explanation of the difference (I have a rough idea of what is going on I think).
2. If iterating over all the edge types is faster than iterating over all the edges, why isn't this the default strategy for outE, inE and bothE?