Repository navigation
Slowness and behavioral while fetching data from OirentDB using Gremlin API #10560
Replies: 1 comment
|
Hi, So yes as today the gremlin query get translated to OrientDB query only in limited cases, and as today do not support or filter. 1-2. As today is not possible, but it should be possible to modify the integration with OrientDB to push down more criteria, here is the code that does that https://github.com/orientechnologies/orientdb/blob/develop/gremlin/driver/src/main/java/org/apache/tinkerpop/gremlin/orientdb/traversal/step/sideeffect/OrientGraphStep.java#L160 (for 3.2.x https://github.com/orientechnologies/orientdb-gremlin/blob/3.2.x/driver/src/main/java/org/apache/tinkerpop/gremlin/orientdb/traversal/step/sideeffect/OrientGraphStep.java#L148 ) PR are welcome to support this additional cases I hope this helps |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I am currently conducting R&D on fetching data using the Gremlin API from an OrientDB database. While evaluating fetch performance between OrientDB Studio and the Gremlin API, I noticed significant performance issues. After investigating the code in detail, I observed the following behavior:
Consider the queries below and their behavior:
Case1:
Query:
SELECT * FROM Table WHERE TableName='ABC'Traversal:
graph.traversal().V().hasLabel("Table").has("TableName", "ABC");Query generated:
SELECT FROM Table WHERE TableName = :param0Observation: The filter is passed directly to the OrientDB server for execution.
Case2:
Query:
SELECT * FROM Table WHERE TableName='ABC' AND TableSize=20Traversal 1:
graph.traversal().V().hasLabel("Table").has("TableName", "ABC").has("TableSize", 20);Query generated:
SELECT FROM Table WHERE TableName = :param0 AND TableSize = :param1Traversal 2:
graph.traversal().V().hasLabel("Table").has("TableName", "ABC").and().has("TableSize", 20);Query generated:
SELECT FROM Table WHERE TableName = :param0 AND TableSize = :param1Observation: For both the traversals, filter is pushed directly to the OrientDB server, and fetch times between OrientDB Studio and the Gremlin API are similar.
Case3:
Query:
SELECT * FROM Table WHERE TableName='ABC' OR TableName='PQR'Traversal 1:
graph.traversal().V().hasLabel("Table").has("TableName", "ABC").or().has("TableName", "PQR");Query generated:
SELECT FROM VObservation: The entire dataset is fetched and filtered in memory, causing performance differences between OrientDB Studio and Gremlin API.
Traversal 2:
graph.traversal().V().hasLabel("Table").or(__.has("TableName", "ABC"), __.has("TableName", "PQR"));Observation: The API fetches all data from class V in OrientGraph, filtering is done in memory, resulting again in performance differences.
Could someone please help me with the following questions?
All reactions