javeme commented on code in PR #2408:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2408#discussion_r1451346361


##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/graph/EdgeAPI.java:
##########
@@ -291,6 +291,19 @@ public String list(@Context GraphManager manager,
         HugeGraph g = graph(manager, graph);
 
         GraphTraversal<?, Edge> traversal;
+
+        // Optimize edge query. Return early when the EdgeLabel does not exist.
+        if (label != null && !g.existsEdgeLabel(label)) {

Review Comment:
   could you please move these logic into 
[GraphTransaction.optimizeQuery()](https://github.com/apache/incubator-hugegraph/blob/57cd0e8dd7035e7dd6cb4581c1ed00ee1b2c83f4/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java#L1450),
 so that it can also be used by Gremlin query.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to