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


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/HugeCountStrategy.java:
##########
@@ -272,6 +272,11 @@ private boolean doStrategy(final Step step) {
             return false;
         }
 
+        final P<?> predicate = ((IsStep<?>) step.getNextStep()).getPredicate();
+        if (predicate instanceof ConnectiveP) {

Review Comment:
   ⚠️ **Important: preserve safe range limiting for flat connective predicates**
   
   Returning here for every `ConnectiveP` bypasses the entire strategy, 
including the safe `RangeGlobalStep` insertion. Common predicates such as 
`between(1, 18)` are connective predicates, so a high-degree `count().is(...)` 
traversal now counts the complete input instead of stopping at the upper 
threshold. The new result assertions do not detect this plan regression. Please 
keep disabling the destructive `NotStep`/`dismissCountIs` rewrites unless 
full-expression equivalence is proven, while retaining a proven-safe range cap 
for analyzable flat connectives (and continue skipping nested cases as needed). 
Add a traversal-plan regression that asserts a representative flat connective 
still receives the range bound.



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