porunov
porunov
ATApache TinkerPop
Created by porunov on 5/18/2024 in #questions
Should `barrier` step merge Edge properties with the same key and value?
I am trying to understand if it is expected for barrier to merge multiple traversers of different Edge properties together (a.k.a. optimization). Currently, as the result of such merging some Edge properties might be missing from the continuing traversal. For example, the following test will fail as the last line because a single property is still left after all "name" properties removal (graph.traversal().E().properties("name").barrier(5).drop().iterate()). I.e. I had impression that barrier step may influence query optimization, but not influence query result. Now I'm trying to understand if that is the intended behavior or not.
@Test
public void testDropsEdgePropertiesTinkerGraph() {
Graph graph = TinkerGraph.open();
Vertex vertex1 = graph.addVertex();
Vertex vertex2 = graph.addVertex();
vertex1.addEdge("relate", vertex2).property("name", "test");
vertex1.addEdge("relate", vertex2).property("name", "test");

assertEquals(1, graph.traversal().E().properties("name").dedup().count().next());
graph.traversal().E().properties("name").barrier(5).drop().iterate(); // should this line remove 2 properties or a single property?
assertEquals(0, graph.traversal().E().properties("name").count().next()); // fails because 1 name property is still there.
}
@Test
public void testDropsEdgePropertiesTinkerGraph() {
Graph graph = TinkerGraph.open();
Vertex vertex1 = graph.addVertex();
Vertex vertex2 = graph.addVertex();
vertex1.addEdge("relate", vertex2).property("name", "test");
vertex1.addEdge("relate", vertex2).property("name", "test");

assertEquals(1, graph.traversal().E().properties("name").dedup().count().next());
graph.traversal().E().properties("name").barrier(5).drop().iterate(); // should this line remove 2 properties or a single property?
assertEquals(0, graph.traversal().E().properties("name").count().next()); // fails because 1 name property is still there.
}
7 replies
ATApache TinkerPop
Created by porunov on 5/26/2023 in #questions
Does bulking optimization provided by LazyBarrierStrategy improves query performance?
I’m having a hard time understanding usefulness of the LazyBarrierStrategy which supposedly adds bulking optimization. In the nutshell LazyBarrierStrategy simply adds barrier(2500) after FlatMapStep. As I understand it means to execute previous FlatMapStep up to 2500 times before moving to the next step. I hardly understand the usefulness of such barrier step being inserted after FlatMapStep. Do you know any use-case when LazyBarrierStrategy improves query performance anyhow or brings any benefit?
9 replies