Alima777 commented on a change in pull request #1399: URL: https://github.com/apache/incubator-iotdb/pull/1399#discussion_r446593110
########## 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: Hi, I replace those objects with WeakReference as you said. I believe it will make sense in the GC. Thank you very much for your good suggestion. Please check it. ---------------------------------------------------------------- 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