# Five Ways to Paginate in PostgreSQL

DevFeed: [Five Ways to Paginate in PostgreSQL](<https://devfeed.tech/articles/five-ways-to-paginate-in-postgresql-21470.md>)

Original publisher: [Read original article](<https://begriffs.com/posts/2016-03-30-five-ways-to-paginate.html>)

Published: 2016-03-30T00:00:00Z

Content type: article

Language: en

Sources: [Joe Nelson](<https://devfeed.tech/sources/joe-nelson.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [web applications](<https://devfeed.tech/topics/web-applications.md>), [Object-relational mapping](<https://devfeed.tech/topics/orm.md>), [SQLAlchemy](<https://devfeed.tech/topics/sqlalchemy.md>)

Tags: [application-development](<https://devfeed.tech/tags/application-development.md>), [database](<https://devfeed.tech/tags/database.md>), [orm](<https://devfeed.tech/tags/orm.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sqlalchemy](<https://devfeed.tech/tags/sqlalchemy.md>), [web-applications](<https://devfeed.tech/tags/web-applications.md>)

## AI overview

This article examines several server-side pagination methods in PostgreSQL, compares their tradeoffs, and explains when client-side pagination may be preferable. It highlights the limitations of limit-offset pagination, including result inconsistency and inefficiency with large offsets.

## Source excerpt

2016-03-30 (Cross-posted on the Citus Data blog.) It may surprise you that pagination, pervasive as it is in web applications, is easy to implement inefficiently. In this article we'll examine several methods of server-side pagination and discuss their tradeoffs when implemented in PostgreSQL. This article will help you identify which technique is appropriate for your situation, including some you may not have seen before which rely on physical clustering and the database stats collector.