jixuan1989 commented on a change in pull request #1399: URL: https://github.com/apache/incubator-iotdb/pull/1399#discussion_r446147306
########## File path: server/src/main/java/org/apache/iotdb/db/query/control/QueryResourceManager.java ########## @@ -85,20 +110,50 @@ public void registerTempExternalSortFile(long queryId, externalSortFileMap.computeIfAbsent(queryId, x -> new ArrayList<>()).add(deserializer); } - public QueryDataSource getQueryDataSource(Path selectedPath, QueryContext context, Filter filter) throws StorageEngineException, QueryProcessException { SingleSeriesExpression singleSeriesExpression = new SingleSeriesExpression(selectedPath, filter); - return StorageEngine.getInstance().query(singleSeriesExpression, context, filePathsManager); + QueryDataSource queryDataSource = StorageEngine.getInstance() + .query(singleSeriesExpression, context, filePathsManager); + // calculate the distinct number of seq and unseq tsfiles + if (config.isEnablePerformanceTracing()) { + seqFileNumMap.computeIfAbsent(context.getQueryId(), k -> new HashSet<>()) + .addAll(queryDataSource.getSeqResources()); Review comment: this method just query one time series.. Suppose we have 2 time series to be queried, maybe the resources corresponding to the first time series can be GC released before the second one is queried. ########## File path: server/src/main/java/org/apache/iotdb/db/query/control/QueryResourceManager.java ########## @@ -85,20 +110,50 @@ public void registerTempExternalSortFile(long queryId, externalSortFileMap.computeIfAbsent(queryId, x -> new ArrayList<>()).add(deserializer); } - public QueryDataSource getQueryDataSource(Path selectedPath, QueryContext context, Filter filter) throws StorageEngineException, QueryProcessException { SingleSeriesExpression singleSeriesExpression = new SingleSeriesExpression(selectedPath, filter); - return StorageEngine.getInstance().query(singleSeriesExpression, context, filePathsManager); + QueryDataSource queryDataSource = StorageEngine.getInstance() + .query(singleSeriesExpression, context, filePathsManager); + // calculate the distinct number of seq and unseq tsfiles + if (config.isEnablePerformanceTracing()) { + seqFileNumMap.computeIfAbsent(context.getQueryId(), k -> new HashSet<>()) + .addAll(queryDataSource.getSeqResources()); Review comment: this method just queries one time series.. Suppose we have 2 time series to be queried, maybe the resources corresponding to the first time series can be GC released before the second one is queried. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org