xiangmy21 commented on code in PR #17065:
URL: https://github.com/apache/iotdb/pull/17065#discussion_r2734528415


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java:
##########
@@ -1435,6 +1479,46 @@ public ISchemaReader<ITimeSeriesSchemaInfo> 
getTimeSeriesReader(
             showTimeSeriesPlan.isPrefixMatch(),
             showTimeSeriesPlan.getScope()) {
 
+          private long remainingOffset = Math.max(0, 
showTimeSeriesPlan.getOffset());
+
+          private boolean shouldPruneSubtree(final IMemMNode node) {
+            if (remainingOffset <= 0) {
+              return false;
+            }
+            final long subtreeCount = node.getSubtreeMeasurementCount();
+            if (subtreeCount <= remainingOffset) {
+              remainingOffset -= subtreeCount;
+              return true;
+            }
+            return false;
+          }
+
+          @Override
+          protected boolean acceptFullMatchedNode(final IMemMNode node) {
+            if (!node.isMeasurement()) {
+              return false;
+            }
+            if (remainingOffset > 0) {
+              // skip this measurement
+              remainingOffset--;
+              return false;
+            }
+            return true;
+          }

Review Comment:
   Exactly! I fixed this issue in 
#[0177c66](https://github.com/apache/iotdb/pull/17065/commits/0177c6699654a66f38fb92809c28c65551a3419a)
    by disabling pushdown when schemaFilter is present, and by refining the 
subtree-skipping logic: a subtree is skipped only when its nodes are fully 
covered by the path pattern.



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

Reply via email to