No, I didn't but I can't just put an index for every node I have?

Isn't there any way like graph.getEdgeByVertex(startVertex, endVertex, 
properties) ?
Or anything which isn't the way like I resolved it above.

Am Mittwoch, 30. November 2016 14:24:36 UTC-2 schrieb Oleksandr Gubchenko:
>
> Hi,  did you tried it using indexes?
>
> Il giorno mercoledì 30 novembre 2016 15:19:24 UTC+1, Ray Neiheiser ha 
> scritto:
>>
>> I have some performance problems with reading edges depending on their 
>> start and end nodes. Is there a better way than checking every edges end 
>> vertex of every start vertex?
>>
>> Iterable<Vertex> startNodes = 
>> getVertexList(relationshipStorage.getStartNode(), graph);
>>                 Iterable<Vertex> endNodes = 
>> getVertexList(relationshipStorage.getEndNode(), graph);
>>
>>                 List<Edge> list = 
>> StreamSupport.stream(startNodes.spliterator(), false)
>>                         .flatMap(vertex1 -> 
>> StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
>> relationshipId).spliterator(), false))
>>                         .filter(edge -> 
>> StreamSupport.stream(endNodes.spliterator(), false).anyMatch(vertex -> 
>> edge.getVertex(Direction.OUT).equals(vertex)))
>>                         .collect(Collectors.toList());
>>
>>

-- 

--- 
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