forked from digma-ai/otel-sample-app-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Issue Description
The /vets.html endpoint is experiencing an N+1 query performance issue when loading veterinarians and their specialties. This is caused by:
- Eager loading of the specialties collection in the Vet entity
- Lack of join fetch optimization in the repository queries
Impact
- Multiple unnecessary database queries are executed for each vet's specialties
- Reduced performance when listing vets, especially with larger datasets
- Potential scalability issues
Solution
A fix has been implemented in PR #94 with the following changes:
- Changed specialties relationship to lazy loading with batch size optimization
- Added optimized repository methods using join fetch
- Updated existing methods to use the optimized queries
Validation
The changes have been tested to ensure:
- Functionality remains the same
- Query performance is improved
- Pagination works correctly
- Caching is preserved
Related PR: #94
Metadata
Metadata
Assignees
Labels
No labels