Using springboot native query is making the api slower in 2million records.Normal sql executes in 1.2s while the query in spring boot is taking 7s why?.What is the possible alternative.Is it due to number of filter parameters i am passing.Want to know the complete analysis instead os short answer like below. Not a dublicate of below one.
Hibernate is 1000 times slower than sql query
@Query(value = "xyz full query");
List<SpDetail> findBySpIdIn(
@Param("status") String status,
@Param("date") String date,
@Param("isWhitelisted") Boolean isWhitelisted,
@Param("clusterName") String clusterName,
@Param("firstBooking") Integer firstBooking,
@Param("reachedOutStatusList") List<String> reachedOutStatusList,
@Param("spMobile") String spMobile,
@Param("limit") Integer limit,
@Param("offset") Integer offset,
@Param("total_orders") Integer totalOrders,
@Param("explicitLoad") Integer explicitLoad,
@Param("reachoutCompletedCount") Long reachoutCompletedCount
);