wangyong9999 commented on code in PR #194:
URL: https://github.com/apache/paimon-cpp/pull/194#discussion_r3775727409


##########
src/paimon/common/global_index/btree/btree_global_indexer.cpp:
##########
@@ -120,8 +123,9 @@ Result<std::shared_ptr<GlobalIndexReader>> 
BTreeGlobalIndexer::CreateReader(
         }
         read_buffer_size = static_cast<int32_t>(tmp_buffer_size);
     }
-    // TODO(lisizhuo.lsz): Allow users to specify an executor
-    std::shared_ptr<Executor> executor = CreateDefaultExecutor();
+    // Readers are created per payload group and may coexist for many buckets. 
Share the
+    // process-wide executor instead of creating a dedicated thread pool for 
every group.
+    std::shared_ptr<Executor> executor = GetGlobalDefaultExecutor();
     return std::make_shared<LazyFilteredBTreeReader>(read_buffer_size, files, 
key_type, file_reader,

Review Comment:
   Updated. `GlobalIndexer::CreateReader` now accepts an external executor. 
`PrimaryKeyIndexBatchScan` creates one scan-scoped executor from 
`global-index.thread-num` and shares it across BTree readers; when unset, it 
preserves the existing C++ CPU-count default. The legacy `GlobalIndexScanImpl` 
path keeps its outer executor separate to avoid nested synchronous work on the 
same fixed-size pool. No executor is created when the plan has no valid index 
group.



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