Performance Considerations with Offset and Cursor Pagination in Plain PHP and Doctrine ORM
Displaying a list of items from the database is probably the most common functionality built for web applications. This is where pagination with LIMIT clause comes into play, which is most likely what you learned to use. This pattern is called offset pagination. In this post I am going to contrast it with cursor pagination and the performance considerations that come with the choice of pagination algorithm. Examples are with Plain PHP and Doctrine ORM 3.7, which ships a new CursorPaginator class.