Efficient Pagination with Spring Data JPA Slice: Skip the COUNT(*) Query
Learn how Spring Data JPA's Slice interface removes the costly COUNT(*) query from pagination, speeding up large‑dataset access while preserving simple next‑page detection.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how Spring Data JPA's Slice interface removes the costly COUNT(*) query from pagination, speeding up large‑dataset access while preserving simple next‑page detection.
A decision guide for Hibernate ORM 6.x identifier generation. Use SEQUENCE with matching allocationSize for most relational tables, reserve IDENTITY for simple schemas, avoid TABLE for high concurrency, and validate with SQL logging and batch insert tests.
Implement Hibernate’s second‑level cache with Ehcache in a single‑node, read‑heavy environment. This architecture note covers minimal configuration, entity annotations, operational checks, failure modes, and when to redesign for optimal performance.
Learn why offset pagination slows down Jeet applications on large tables and how cursor‑based pagination using an indexed key provides stable, fast page loads.
Learn how to diagnose and fix unstable result sets and performance lag when using Hibernate's setFirstResult and setMaxResults for database pagination.
Stop repeating the same GORM filters. Learn how DetachedCriteria lets you define query logic once, combine it safely, and execute it inside an active Grails session.
Unbounded findAll() calls risk OOM as tables grow. Learn how Spring Data JPA Pageable bounds queries, why the default count query hurts, and when to switch to keyset pagination.
JPA offset pagination works for bounded admin pages but degrades on deep feeds. Learn when to use setFirstResult, when to switch to keyset pagination, and how to verify the generated SQL.
Prevent OutOfMemoryErrors in Hibernate by resolving the HHH000104 warning. Learn the two-step fetching pattern to combine JOIN FETCH with database-level pagination.