intermediateProjections, Pagination & Sorting

What's the performance difference between Page and Slice?

Page executes your paginated query plus a separate COUNT query to report the total number of results. Slice skips that count query entirely, only fetching one extra row to determine whether a next page exists — cheaper, but it can't tell you the total page count.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.

What's the performance difference between Page and Slice?

Next Step

Continue to Why would you use an interface-based projection instead of returning full entities from a repository method?← Back to all Spring Data JPA & Hibernate Mastery questions