Why are interface projections much slower than constructor projections and entity projections in Spring Data JPA with Hibernate?
I've been wondering which kind of projections should I use, so I did a little test, which covered 5 types of projections (based on docs: https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#projections ): 1. Entity projection This is just a standard findAll() provided by Spring Data repository. Nothing fancy here. Service: List<SampleEntity> projections = sampleRepository.findAll(); Entity: @Entity @Table(name = "SAMPLE_ENTITIES") public class SampleEntity { @Id private Long id; private String name; private String city; private Integer age; } 2. Constructor projection Service: