ZhYQ1 opened a new issue, #429:
URL: https://github.com/apache/hugegraph-ai/issues/429

   ### Search before asking
   
   - [x] I had searched in the 
[feature](https://github.com/apache/hugegraph-ai/issues?q=is%3Aissue+label%3A%22Feature%22)
 and found no similar feature requirement.
   
   
   ### Feature Description (功能描述)
   
   ## Problem
   
   In the id-to-match subgraph branch, `GraphQueryNode._subgraph_query()` 
issues one gremlin `exec` per matched vid:
   
   - file: 
`hugegraph-llm/src/hugegraph_llm/nodes/hugegraph_node/graph_query_node.py`, the 
loop over `matched_vids` (the existing `# TODO: use generator or asyncio to 
speed up the query logic`)
   - cost: with N matched vids, `1 + N` sequential server round-trips per graph 
query
   
   ## Proposal
   
   Group `matched_vids` into small batches (10) and issue one `exec` per batch, 
concatenating each batch's `data` in `matched_vids` order. The full-vertex 
query (`VERTEX_QUERY_TPL`) and the property-match branch stay unchanged. This 
turns `1 + N` into `1 + ceil(N / 10)` round-trips, with no public API change.
   
   ## Considerations
   
   - Ordering is preserved. When a batch hits the global `.limit(max_items)`, 
results can be a subset of the old per-vid union — the same trade-off the 
property-match branch already makes (one global limit across all keywords). A 
stricter alternative is per-vid limiting via `flatMap(... .limit(max_items))`, 
which needs a live server to validate.
   - Same file as #383 / #385 / #412: rebase-order risk only, no semantic 
overlap.
   - Not a duplicate of #421 (build-time matched-vertex dedup); this is 
query-time batching.
   - Baseline: `perf/query-links-batch @215f248`.
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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