spatie/laravel-fast-paginate
A fast limit/offset paginator for Laravel. The fastPaginate method selects only primary keys first so late pages stay fast, then fetches full rows for that page. Same signature and paginator as Laravel's paginate, so no other code changes.
Architecture fit
fastPaginate replaces a single wide LIMIT/OFFSET query with a two-phase read — an index-only primary-key scan for the page, followed by a fetch of full rows for those keys.Integration feasibility
composer.json; the README excerpt alone is insufficient.total, and whether the returned paginator is compatible with existing API resources and front-end page controls.Technical risk
ORDER BY clauses can produce duplicate or missing rows across pages because the second query fetches by key without reapplying the original ordering semantics.GROUP BY, HAVING, DISTINCT, UNION, global scopes, soft deletes, composite primary keys, and queries with custom select clauses.2026-08-07); validate package provenance and tags before locking it into production.Key questions
total computed, and can the count query dominate performance?orderBy, composite keys, joins, groupBy, distinct, and soft deletes?Stack fit
Migration path
paginate/simplePaginate as the fallback.Compatibility
per_page, and last_page semantics must remain unchanged, or the UI must be updated deliberately.Sequencing
fastPaginate on a replica at realistic depths, including count-query behavior.Maintenance
Support
Scaling
fastPaginate alone.Failure modes
groupBy, distinct, or composite keys.total/last_page.Ramp-up
How can I help you explore Laravel packages today?