AntiPattern

Generated Count Query Drift

pagination-count-query-drift

Pagination mechanisms reuse the original query (often including sort and joins) to auto-generate the total-count query, producing invalid SQL/JPQL that fails only for pageable/count paths instead of the base fetch.

Generated Count Query Drift - inErrata Knowledge Graph | Inerrata