Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

Pagination Performance: How to Diagnose a Query That Gets Slower

Deep pages can cost more because the database may process rows or hits it will not return. Diagnose the endpoint before choosing offset, keyset, or search cursor pagination.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A paginated query that slows down over time may be paying to skip more rows or search hits—but the symptom alone does not prove pagination is the cause. Compare shallow and deep requests, their execution plans, and their database-side costs before changing the endpoint. If the slowdown tracks page depth, seek-based pagination may help for sequential navigation; if it tracks elapsed time instead, investigate the query, data, indexes, workload, and surrounding application path.

Why later pages can cost more

With LIMIT/OFFSET, the database must find the requested position and return the following window. Rows skipped by a large offset still have to be computed; PostgreSQL warns that a large OFFSET might therefore be inefficient. MongoDB likewise documents that skip() gets slower as the offset increases, and that indexed range queries can typically outperform skip as offsets grow. The size of the penalty depends on the engine and execution plan, not on a universal slowdown formula. (PostgreSQL documentation; MongoDB cursor.skip documentation)

As an Amazon Associate I earn from qualifying purchases.

Search pagination has its own mechanics. In Elasticsearch, from/size pagination across shards makes shards load hits for earlier pages as well as the requested page, which can increase memory and CPU use on deep pages. Elastic advises against paging too deeply with from and size. This is not interchangeable with SQL behavior, so diagnose the system actually serving the endpoint. (Elastic documentation)

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Deep offsets are one plausible explanation, not a complete post-mortem. A query can also regress because its plan, indexes, filters, sort, data distribution, cache conditions, or workload changed. The title alone supplies no database, query plan, or timing evidence to identify which cause applies.

#1 Best Overall
Dell PowerEdge R730xd Server 24B SFF 2U, 2X Intel Xeon E5-2690 v4 2.6Ghz (28-cores Total), 128GB DDR4 RAM, 4X 1.2TB 10K SAS 2.5” 12Gb/s HDD, H730P 2GB RAID, NIC 10Gb + I350 1Gb (Renewed)
  • Dell PowerEdge R730xd 24B SFF 2U Server
  • 2x Intel Xeon E5-2690 v4 2.6Ghz 14-Core (28-cores Total)
  • 128GB DDR4 RAM – 4x 1.2TB 10K SAS 2.5” 12Gb/s
  • Dell H730P mini 2GB 12Gb/s RAID
  • 2x 750W PSU - 2x 10Gb SFP+ 2x 1Gb (RJ45) NIC

First establish what is getting slower

  1. Capture the exact request. Record the SQL or search request, parameter values, sort order, page size, and representative shallow and deep positions. Include the request that users experience as slow rather than testing a simplified query that changes its behavior.
  2. Make the ordering deterministic. Check that results have an explicit order and that the final sort key uniquely breaks ties. PostgreSQL warns that LIMIT/OFFSET subsets are unpredictable without an ORDER BY that constrains rows to a unique order; plan changes can otherwise produce different subsets. (PostgreSQL documentation)
  3. Compare shallow and deep execution. Use the database’s native execution-plan and timing or buffer metrics for the same filters, order, and page size at different positions. Look for work spent finding skipped rows or hits, and compare the plan as well as elapsed time.
  4. Separate database time from the rest of the request. Measure query execution independently from serialization, network transfer, application processing, and any separate count query. A slow response does not by itself show that the page-fetch query is slow.
  5. Inspect index support. Check whether the filters and ordering keys have useful index support for this query and data distribution. MongoDB’s query-optimization guidance recommends indexes for commonly issued queries and explains that indexes improve queries on indexed fields. An index must fit the actual predicate and sort; adding one without checking the plan is not a diagnosis. (MongoDB documentation)
  6. Repeat under representative conditions. Compare measurements with representative data and workload. A rewrite is not evidence of a fix until the endpoint’s relevant costs and behavior improve in those conditions.

Choose pagination to match how people navigate

The right approach depends on whether users need arbitrary numbered-page jumps, sequential traversal, or a search-specific continuation mechanism.

Approach Best fit Deep-page cost and constraints Navigation and consistency
LIMIT/OFFSET or skip Shallow pages, numbered pages, and direct jumps Large offsets may require processing skipped rows or hits; cost varies by engine and plan. (PostgreSQL; Elastic; MongoDB) Use a deterministic order. Changes between separate requests can affect which records appear on a page.
Keyset or range pagination Sequential feeds and APIs that move forward or backward through an ordered result set Continue from the last seen sort key rather than counting past prior rows. Requires an appropriate index and a predicate that handles the full sort tuple. MongoDB documents indexed range queries as typically more efficient than skip as offsets increase. (MongoDB) Natural for next/previous traversal; arbitrary page-number jumps and exact page counts are less natural. The anchor is the last result, so a product that requires “go to page 237” may still need a different interface or strategy.
Search-after or cursor token Search engines and APIs with a documented continuation mechanism Sort and token requirements are engine-specific. For deep Elasticsearch traversal where the index state must stay consistent, Elastic recommends search_after with a point in time. (Elastic documentation) Cursor semantics and snapshot guarantees vary by product and deployed version; verify the behavior of the actual system.
Server-side cursor or bulk traversal Batch processing and exports May hold server-side state or require initial result work; it is not automatically appropriate for interactive page requests. Elastic describes scroll as intended for large-volume processing rather than real-time user requests. (Elastic documentation) Can suit traversal of a stable result context, with resource and lifetime considerations specific to the engine.

How to prototype keyset pagination safely

Keyset pagination resumes after the last result seen rather than asking the database to skip a count of earlier rows. For a sequential endpoint, prototype it with the complete ordering tuple and a stable unique tie-breaker. For example, if the order is by creation time and then a unique record ID, the continuation predicate must account for both values; comparing only the timestamp can omit or duplicate records when timestamps tie. The exact predicate and index depend on the database, sort direction, filters, and schema, so they should be confirmed against that engine’s plan rather than copied from a generic example.

Rank #2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
  • Model: Dell OptiPlex 7050 Small Form Factor (SFF)
  • Processor: Intel Core i7-7700 3.60 GHz
  • Memory: 32GB DDR4 Ram
  • Storage: 1TB Solid State Drive (SSD) Fast Boot + Storage
  • Operating System: Windows 11 Pro (64-bit)
  • Define whether each page sees a fresh view of the data or should remain within a consistent snapshot. Inserts and deletions between requests can change what a user sees; test that behavior explicitly.
  • Provide a continuation token or equivalent anchor based on the last returned sort values when the client does not need page-number jumps.
  • Test both directions if the interface supports previous as well as next, including ties and records added or removed between requests.
  • Check the actual execution plan and measurements after the change. Seek-based traversal still depends on suitable indexing and query shape; it is not guaranteed to have constant cost in every implementation or workload.

Account for count queries and search consistency

A page request may issue a separate count to display a total or determine whether more results exist. That count can have its own cost and should be measured separately from fetching the page. MongoDB Search specifically warns that counting results can affect performance and advises using its count option only when needed. (MongoDB Search documentation)

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For Elasticsearch deep traversal, use the documented search_after and point-in-time mechanism when a consistent index state is required. MongoDB Search also supports searchAfter and searchBefore tokens for moving from a reference point. These are product-specific features, not interchangeable cursor guarantees; confirm their requirements and consistency behavior for the deployed version. (Elastic; MongoDB Search)

Rank #3
Hewlett Packard Enterprise ProLiant MicroServer Gen11 Tower Server with Intel Xeon 6315P, 16GB DDR5, 4LFF Bays, 180W PSU (P86811-005)
  • 2.80 GHz processor speed ensures efficient operation with consistent reliability
  • Intel Xeon 2.80 GHz processor provides enterprise-grade performance with built-in security and remote management capabilities
  • Quad-core (4 Core) processor core helps server process data quickly and reliably for maximum productivity
  • 1 processors supported for faster processing and improved access to data, optimizing performance under heavy loads
  • With 16 GB memory, you can multitask between applications seamlessly, keeping productivity high and response times quick
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What a defensible post-mortem can conclude

If deeper positions consistently require more database work while other request costs remain comparable, the evidence supports deep pagination as a contributor. If the slowdown occurs regardless of page depth, or the database work does not rise with depth, the investigation should follow the evidence toward plans, indexes, workload, counts, or application overhead instead. Without measurements from the actual endpoint, no particular cause—or successful fix—can be claimed.

Best Value
HP Z4 G4 Workstation, Intel Xeon W-2133 (6-Core) up to 3.9GHz, 64GB DDR4, 512GB NVMe M.2 SSD + 2TB HDD, Nvidia Quadro P400 2GB, USB 3.1, Windows 11 Pro (Renewed)
  • HP Z4 G4 Workstation Tower
  • Intel Xeon W-2133 6-Core 3.6GHz (3.9GHz Turbo)
  • 64GB DDR4 Memory - Nvidia Quadro P400 2GB
  • 512GB NVMe M.2 SSD (boot) + 2TB HDD (storage)
  • Windows 11 Pro 64-bit
Rank #4
HPE Hewlett Packard Enterprise ProLiant MicroServer Gen11 Tower Server, Intel Pentium Gold G7400 Processor, 16GB Memory, 1TB HDD Storage, External 180W US Power Supply Smart Choice P74439-005
  • MODEL P74439-005: Compact and affordable HPE ProLiant MicroServer Gen11 powered by Intel Pentium Gold G7400 3.7GHz processor, ideal for file sharing, NAS, and basic business workloads
  • READY OUT OF THE BOX: Includes 16GB DDR5 UDIMM memory (expandable to 128GB), one 1TB SATA 6G Business Critical HDD, embedded Intel VROC SATA, dedicated iLO-M.2 port kit, 180w external power adapter and 1/1/1 warranty for dependable plug-and-play server operation
  • WHISPER-QUIET & SPACE-SAVING: Ultra-compact mini tower design fits easily in small office spaces; supports wall, flat, or vertical placement for deployment flexibility
  • INTEGRATED REMOTE MANAGEMENT: Comes with HPE iLO 6 and embedded TPM 2.0 for secure, license-free remote server administration through shared port access
  • EXPANDABLE DESIGN: Two PCIe slots (including PCIe 5.0) and four LFF-NHP drive bays provide robust options for storage and component scalability. Features new MR408i-p controller support for enhanced storage performance

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.