Skip to content

Spring Data Jdbc findAll low performance for native application #1683

Closed
@Ferioney

Description

@Ferioney

Hi,

I faced a performance issue with Spring Data Jdbc with native application. It isn't easy to prepare a demo cause I found this issue in the production code. But I will try to explain.

Let's say I have a simple Spring Data repository:

public interface DemoJdbcRepository extends CrudRepository<DemoEntity, Long> {
        @Query("select d.* from demo_table d where d.status in (:statuses)")
        List<DemoEntity> getDemoByStatusId(@Param("statuses") Set<Integer> statuses);
}

In demo_table I have 600,000 records for searched statuses. For Java applications, this method takes an average of 5 sec. When I switched to the native application, this method took more than 100 sec.
I prepared a flame graph for native application:
perf-native-spring-data

Could you please explain if it is expected behavior for native? and maybe we can improve the performance of Spring Data somehow

Metadata

Metadata

Assignees

Labels

for: external-projectFor an external project and not something we can fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions