imbajin commented on code in PR #2994:
URL: https://github.com/apache/hugegraph/pull/2994#discussion_r3623455862


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/TraversalUtil.java:
##########
@@ -445,14 +445,34 @@ private static boolean 
extractHasContainers(HugeVertexStep<?> newStep,
 
     private static boolean canExtractHasContainers(HugeGraph graph,
                                                    HasContainerHolder holder) {
-        for (HasContainer has : holder.getHasContainers()) {
+        List<HasContainer> hasContainers = holder.getHasContainers();
+        // Keep unsafe labels and their sibling properties for local filtering.
+        for (HasContainer has : hasContainers) {
+            if (has.getKey().equals(T.label.getAccessor()) &&

Review Comment:
   ‼️ Keeping this holder local only protects predicates in the same `HasStep`. 
Both extraction loops continue across `NoOpBarrierStep`, so `g.V().has(T.label, 
P.neq("author")).barrier().has("city", "Beijing")` retains the LABEL filter but 
still pushes `city` into `HugeGraphStep`. If only `person.city` is indexed, a 
matching unindexed `fan` never reaches the retained filter, silently dropping a 
valid result; the `HugeVertexStep` path has the same control flow. Please stop 
later pushdown after an unsafe LABEL holder (or pre-scan the whole 
barrier-separated chain), and add vertex and edge regressions with a matching 
unindexed label.



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