-
Notifications
You must be signed in to change notification settings - Fork 115
[Feature Request] - Parallel Fetching of Associated Fields in SELECT
Mode
#1018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Considered and discussed issues, this feature will not be considered before version 1.0.
|
@babyfish-ct Thank you for the detailed explanation and thoughtful considerations. I fully understand the concerns regarding version planning, transaction safety, and the potential learning curve for new users. In traditional ORM frameworks, it's quite common for developers to manually load associated entities, and in many of our projects, we are already used to doing this concurrently—especially in read-only query scenarios that do not rely on Spring's transaction mechanism. What makes this request relevant to Jimmer is precisely because of its elegant Fetcher design. If I want to parallelize data loading, I would have to bypass the Fetcher and manually assemble DTOs with concurrent calls. This adds extra complexity and diminishes the benefits that Fetcher offers in terms of clarity and maintainability. Of course, I understand your focus on solidifying core features before 1.0. I just hope that in the future, you might consider offering some form of explicit opt-in API for enabling concurrent loading—at least for advanced users who are working in controlled, non-transactional contexts. Even a low-level API would be extremely helpful in such cases. Thanks again for the open discussion and your vision for Jimmer. I'm very much looking forward to seeing what the framework evolves into after 1.0! |
Reason
背景问题
当前 Jimmer 的抓取器(
Fetcher
)在抓取模式为SELECT
时,对于关联字段的抓取是串行处理的。即便多个关联字段可以同时查询,它们仍然是逐个顺序触发的。这在高延迟数据库或复杂对象树结构中,容易成为性能瓶颈。然而,这些操作属于 IO 密集型任务,而非 CPU 密集,因此完全可以通过并行化显著提升吞吐量。
Problem
Currently, in
SELECT
mode, Jimmer'sFetcher
loads associated fields sequentially, even if they are independent. These operations are IO-bound (not CPU-bound), and in many scenarios (e.g. high-latency DB, large object graphs), sequential loading becomes a performance bottleneck.Description
功能提议
希望 Jimmer 能够:
使用示例
在 Java 中:
目前
teams()
和roles()
是顺序执行的,如果能够并发加载,性能将显著提升。理想配置方式示例:
Proposal
Allow parallel fetching of associated fields by:
Example
Currently,
teams()
androles()
are loaded one after another. Parallel execution could dramatically reduce response time.Ideal Configuration Example
Existing solutions
No response
The text was updated successfully, but these errors were encountered: