Spring Data JPA: Page<T> with COUNT query vs Slice<T> for paginating a multi-million-row table
I'm designing a read endpoint over a table expected to hold tens of millions of rows, using Spring Data JPA (assume Spring Boot 3.x / Spring Data JPA 3.x). The API needs stable, bounded queries, but I'm torn between two documented approaches: returning Page<T> from a repository method with a Pageable , versus returning Slice<T> to skip the total-