Hi John,

you have two alternatives:

1) use OrientVertex.countEdges() to check which of the two vertices has a
smaller number of edges. This approach is good if you know that at most one
is a supernode

2) if you know that both vertices can be supernodes, then the only
efficient way to find the edge is to define and index on edge(out, in) and
do the indexed query directly

I hope it helps

Thanks

Luigi


2017-03-16 11:18 GMT+01:00 John J. Szucs <john.j.sz...@gmail.com>:

> I need to *very quickly* find the edges that directly connect two
> specified vertices, using either a SQL query, the Java API, or a
> combination of the two. If it helps, at this point in the program, I know
> for a fact that the two vertices are adjacent. What I'm trying to determine
> is *how* they are adjacent.
>
> The OrientVertex.getEdges(OrientVertex, Direction, String ...) extension
> to the Blueprints API does what I need to do functionally, but it can be
> quite slow if the first vertex has many edges. Looking into the source
> code, I found that this is because this method essentially gets *all* of
> the edges from the first vertex that match the direction and label criteria
> and then checks if they are adjacent (connect to) the second vertex.
>
> I have struggled with this for days. Does anyone have a better/faster
> approach?
>
> Thanks!
>
> -- John
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to orient-database+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

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

Reply via email to