#37220 assigned Uncategorized

A Count-less Paginator for high-performance navigation

Reported by: Harvey Bellini Owned by: Harvey Bellini
Component: Uncategorized Version: 6.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The new paginator provides a way to navigate results without performing a COUNT(*) query, instead determining the existence of a "next page" by fetching N + 1 items.

Problem

On large PostgreSQL or MySQL tables, SELECT COUNT(*) requires a full or partial index scan that scales linearly with data size. Even if the actual data fetch is fast (via indexed slicing), the Paginator is forced to wait for the count to:

  • Validate the page number
  • Determine if a "next" page exists
  • Calculate the total number of pages for the UI

In many modern UIs (like "Infinite Scroll" or "Next/Prev" only navigation), the total page count is unnecessary and actively hurts performance.

https://github.com/django/new-features/issues/136

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top