Description
cda opened DATAJPA-1721 and commented
Using SimpleJpaRepository.findById(ID is) results in a query with left outer joins for each eager relationship.
Using SimpleJpaRepository.findAllById(Iterable ids) results in a query that fetches current entity columns and additional select queries for each eager relationship.
The performance of findAllById is affected by the additional select queries. Ideally it should generate the same query as findById but with id in () instead of id = .
SimpleJpaRepository.findAllById(Iterable ids) is generating a JPQL query to fetch entities and reading Vlad Mihalcea article it seems that using JPQL to fetch entities uses a different fetching strategy than entitymanager.find that results in additional selects
No further details from DATAJPA-1721