There is an N+1 query performance issue in the /owners endpoint where the application makes one query to fetch owners followed by N separate queries to fetch each owner's pets.
Root Cause:
- EAGER fetching of pets collection in Owner entity
- Missing fetch join optimization in repository queries
- No batch fetching configuration
Solution:
- Changed fetch type to LAZY to prevent unnecessary loading
- Added @entitygraph for optimized loading when needed
- Implemented @batchsize for efficient batch fetching
A pull request has been created with these changes: #433
This issue is being tracked as part of incident #6b373e96-616c-11f0-a2c1-c67c199f5e31