contrueCT commented on code in PR #2994:
URL: https://github.com/apache/hugegraph/pull/2994#discussion_r3901854425
##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/TraversalUtil.java:
##########
@@ -645,14 +656,67 @@ private static boolean
extractHasContainers(HugeVertexStep<?> newStep,
private static boolean canExtractHasContainers(HugeGraph graph,
HasContainerHolder holder) {
- for (HasContainer has : holder.getHasContainers()) {
+ // Keep unsafe labels and their sibling properties for local filtering.
+ if (hasUnsafeLabelPredicate(holder)) {
+ return false;
+ }
+ List<HasContainer> hasContainers = holder.getHasContainers();
+ for (HasContainer has : hasContainers) {
if (!canExtractHasContainer(graph, has)) {
return false;
}
}
return true;
}
+ private static boolean hasUnsafeLabelInChain(Step<?, ?> step,
+ boolean
followPositiveLabelOr) {
+ // Partial pushdown can lose candidates before local label filtering.
+ // FIXME: Restore selective pushdown when every candidate schema label
+ // has compatible index coverage for extracted property predicates.
+ while (step instanceof HasStep || step instanceof NoOpBarrierStep) {
Review Comment:
Fixed in 29794a9c. `hasUnsafeLabelInChain()` now continues across
`RangeGlobalStep` and `IdentityStep`, so an unsafe label predicate after
`skip()`/`limit()` prevents the earlier partial property pushdown from dropping
candidates. I added end-to-end memory-backend regressions in both
`VertexCoreTest` and `EdgeCoreTest`, covering `skip(0)` and a large
`limit(1000)`. Both new tests pass locally, and the existing barrier
regressions remain green. Thanks for the precise reproducer.
--
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]