imbajin commented on code in PR #2982:
URL: https://github.com/apache/hugegraph/pull/2982#discussion_r3068218442
##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java:
##########
@@ -783,8 +783,10 @@ protected Iterator<Vertex> queryVerticesByIds(Object[]
vertexIds, boolean adjace
// NOTE: allowed duplicated vertices if query by duplicated ids
List<Id> ids = InsertionOrderUtil.newList();
Map<Id, HugeVertex> vertices = new HashMap<>(vertexIds.length);
+ Set<Id> fetchedIds = InsertionOrderUtil.newSet();
+ IdQuery batchQuery = null;
+ final int batchSize = this.batchSize;
Review Comment:
⚠️ 这里把 batching 放在 `GraphTransaction` 通用层后,会影响所有 backend,而不只是 issue #2674
里提到的 RPC backend。
以 RocksDB 为例,当前 `queryByIds()` 仍然是逐 id 展开查询,并没有真正走 multi-get;现在强制按
`query.batch_size` 拆成多个 `IdQuery`,很可能只是增加额外的 query/iterator 次数。建议把这类分批策略下沉到具体
backend,或者至少通过 feature/store type 把它限定在 HBase/HStore 这类 RPC backend
上,避免把针对性优化变成全局行为变化。
PS: 后续我们应该让 RocksDB 使用上原生的 multi-get API (这应该是之前的 TODO)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]