This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch ty/TableModelGrammar
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/ty/TableModelGrammar by this 
push:
     new d3bf81a6fc8 Support memory control in index scan
d3bf81a6fc8 is described below

commit d3bf81a6fc88fddd68095cbc22d553955baac3be
Author: Jackie Tien <[email protected]>
AuthorDate: Thu Aug 1 14:11:15 2024 +0800

    Support memory control in index scan
---
 .../plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java
index d146186b49d..202e83feeab 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java
@@ -382,11 +382,12 @@ public class TableDeviceSchemaFetcher {
           constructNodsArrayAndAttributeMap(
               attributeMap, nodes, 1, columnHeaderList, columns, 
tableInstance, i);
           final IDeviceID deviceID = 
IDeviceID.Factory.DEFAULT_FACTORY.create(nodes);
-          // TODO table metadata: add memory control in query
-          deviceEntryList.add(
+          DeviceEntry deviceEntry =
               new DeviceEntry(
                   deviceID,
-                  
attributeColumns.stream().map(attributeMap::get).collect(Collectors.toList())));
+                  
attributeColumns.stream().map(attributeMap::get).collect(Collectors.toList()));
+          mppQueryContext.reserveMemoryForFrontEnd(deviceEntry.ramBytesUsed());
+          deviceEntryList.add(deviceEntry);
           // Only cache those exact device query
           // Fetch paths is null iff there are fuzzy queries related to id 
columns
           if (Objects.nonNull(fetchPaths)) {

Reply via email to