imbajin commented on code in PR #2994:
URL: https://github.com/apache/hugegraph/pull/2994#discussion_r3412968192
##########
hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreTable.java:
##########
@@ -643,11 +686,33 @@ protected BackendColumnIterator queryByRange(Session
session,
// this.table(), bytes2String(ownerStart),
// bytes2String(ownerEnd), bytes2String(start),
// bytes2String(end), type, cq.bytes());
- return session.scan(this.table(), ownerStart,
- ownerEnd, start, end, type, cq.bytes(),
position);
+ return session.scan(this.table(), ownerStart, ownerEnd, start,
+ end, type, cq.bytes(), position);
+ }
+ return session.scan(this.table(), ownerStart, ownerEnd, start, end,
+ type, null, position);
+ }
+
+ static boolean shouldUseOrderedRangeScan(IdRangeQuery query) {
Review Comment:
‼️ **Keep ordered range scans on every order-sensitive HStore path**
Evidence: `GraphIndexTransaction.keepBackendIndexOrder()` marks HStore range
indexes as order-sensitive whenever the original query has a finite
limit/offset, but this gate only enables the new globally ordered merge for
`paging && limit <= net.kv.scanner.page.size`. The fallback below still calls
`session.scan(...)`, which reaches the legacy `mergeRangeScanIterators()` path
in `NodeTxSessionProxy`; its existing test asserts partition/top-work order
like `3,1,4,2`, not global range-key order.
Impact: multi-partition HStore range-index queries can still return the
wrong first `n` ids, skip the wrong ids for `range()/offset`, or page
incorrectly when the requested page size is above the scanner page size. Please
route all order-sensitive HStore range-index scans through the ordered merge,
or make the graph layer fall back to a correctness-preserving full ordered scan
before applying offset/limit.
--
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]