A warehouse clerk opens the newest orders, handles a query and clicks Next. A fresh order arrived while they were reading, pushing the previous page’s last row onto the next page. The clerk sees it twice and wonders whether other orders are missing. This is a page-boundary problem. It can happen even when the order records are correct.
Decide how staff use the list
Numbered pages work for small lists and when users need to jump directly to a page. A live operations queue works differently. Staff normally read from newest to oldest, and the list changes as they work. Ask whether the screen is for browsing live orders, finding a known order or exporting a fixed set for reconciliation. These jobs can share filters while using different ways to retrieve results.
Continue from the last row the user saw
Offset pagination skips a fixed number of rows. When new orders arrive at the top, that offset can land on a row the clerk has already seen. PostgreSQL’s LIMIT and OFFSET documentation also explains that the database still computes skipped rows and that consistent pagination requires a uniquely ordered result.
For a descending order feed, sort by the creation timestamp and use a unique order ID to break ties. The cursor stores both values from the final displayed row. The next request applies the same filters and starts after that pair in the same sort order. For example, if orders 415 and 414 were created in the same second and page one ends at 415, order 414 must still be eligible for page two. A timestamp-only boundary would lose that distinction. PostgreSQL’s row comparison documentation explains how ordered row comparisons work.
Test the changes that happen between clicks
- Load the first page and insert a newer order in a test environment. Check that the next page continues from the same boundary and that refreshing the first page shows the new order.
- Create rows with identical timestamps and verify that each appears once across the boundary. Measure deep-page response times with typical filters before selecting an index.
- Change the branch or status filter and confirm the list restarts. Keep permissions on every request, even when a valid cursor is supplied.
A cursor does not freeze a changing result set. A row can move if the chosen sort field is edited, and a row can enter or leave a filtered list as its status changes. A reconciliation export may require a separately defined snapshot. For slow ordered queries, see the PostgreSQL query plan guide.
Share an example of the duplicated order row.
Review your business app’s order list
ITZ’s custom software development service can review your sorting, filters and page boundaries. Share the affected screen and how staff navigate it. Review Your Order List Pagination