vladmihalcea / hypersistence-optimizer

Hypersistence Optimizer allows you to get the most out of JPA and Hibernate. By scanning your application configuration and mappings, Hypersistence Optimizer can tell you what changes you need to do to speed up your data access layer.
https://vladmihalcea.com/hypersistence-optimizer/
Apache License 2.0
306 stars 43 forks source link

Detect N+1 query issues triggered by eager loading #154

Closed vladmihalcea closed 2 years ago

vladmihalcea commented 2 years ago

Either explicit (FetchType.EAGER) or implicit (@OneToOne(mappedBy)) eager fetching can trigger N+1 query issues. We need to intercept and count the number of queries that get executed and report the N+1 query issues when happening due to a JPQL or Criteria API that doesn't JOIN FETCH the associations.

vladmihalcea commented 2 years ago

Fixed.