Skip to content
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

Use smarter persistence context for findEach/iterate/stream queries - improve performance of un-tuned findEach/iterate/stream queries that invoke lazy loading #2021

Closed
rbygrave opened this issue Jun 17, 2020 · 0 comments
Assignees
Labels
Milestone

Comments

@rbygrave
Copy link
Member

These changes should improve the performance of untuned findEach/iterate/stream queries that invoke lazy loading.

Changes:

  • Enable use existing persistence context (e.g. beans loaded by prior queries in the same transaction)

  • Use a smarter persistence context with a "per 1000 beans added" reset limit. This improves our use of batch lazy loading during iteration

Current limitations

The current implementation of has a few limitations which this change addresses. The findEach etc queries create their own persistence context effectively per "top level bean". The short lived persistence contexts allows these queries to support iterating of many thousands or millions of rows without having to how all the loaded beans in memory (ie. as we no longer have all beans referenced in a single persistence context).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant