Skip to content

Conversation

shaykeren
Copy link

This PR addresses the N+1 query performance issue in the Vets endpoint by:

  1. Changing the fetch type from EAGER to LAZY in the Vet entity's specialties relationship
  2. Adding @batchsize annotation to optimize batch loading
  3. Implementing @entitygraph for efficient loading of specialties
  4. Adding database indexes on vet_specialties.vet_id, vet_specialties.specialty_id, and specialties.id

These changes should significantly improve the performance of the /vets.html endpoint by reducing the number of database queries executed.

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

Successfully merging this pull request may close these issues.

1 participant