I have a query like below in my JpaRepository.
I have the Pageable size as 1000 records, but HINT_FETCH_SIZE as 50.
Does this mean to fill the Page of 1000 records, this query is called 20 times (20 x fetch size 50)?
Is my understanding correct?
What could be the ideal HINT_FETCH_SIZE if we need a Pageable of 1000 records?
@QueryHints(value = @QueryHint(name = HINT_FETCH_SIZE, value = "50"))
@Query("SELECT m FROM sales m " +
"WHERE m.settlementDate >= :start " +
"AND m.settlementDate < :end " +
"ORDER BY m.salesId")
Page<Sales> findBySettlementDatePage(
@Param("start") LocalDate start,
@Param("end") LocalDate end,
Pageable pageable);