spring-projects / spring-projects/spring-data-rest
SDR queries all associations even if they are not in the requested projection [DATAREST-1089]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Josh Wand opened DATAREST-1089 and commented
I have noticed that even when specifying a lightweight projection, SDR nonetheless queries every single association on my entity, without checking to see if it's in the projection. This results in many extra DB queries that are dramatically slowing down my application.
I've traced the code to this line:
There are checks to see if the association is linkable, or if itself has an excerpt projection, but not to see if the requested association is specified in the projection itself.
Can this check be added? This is a major performance issue.
(see also https://stackoverflow.com/questions/44379069/how-to-avoid-n1-queries-with-spring-data-rest-projections )
3 votes, 5 watchers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.