Opened 10 years ago
Closed 9 years ago
#26451 closed New feature (wontfix)
extend Paginator to support infinite pagination and postgres estimated count
| Reported by: | Denis Cornehl | Owned by: | Denis Cornehl |
|---|---|---|---|
| Component: | Core (Other) | Version: | 1.9 |
| Severity: | Normal | Keywords: | |
| Cc: | Johannes Maron | Triage Stage: | Accepted |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
We often have problems with bigger tables and slow count(*) performance.
depending on the use-case there are two ways to improve the situation
- just work without count, if you never show the page-count. Then the paginator can just return empty results if the end is near.
- use rough estimations for the page-count, perhaps with some security margin. For example PostgreSQL supports this by using
EXPLAIN, based on the table statistics.
I want to
- extend the paginator to support both (infinite and estimate)
- provide an option for
ModelAdminthat let's you use the estimation-paginator. - or perhaps even support the infinite-paginator, this would also include interface changes to the pagination.
Change History (6)
comment:1 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 10 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:4 by , 10 years ago
For MySQL, see also http://django-mysql.readthedocs.org/en/latest/queryset_extensions.html#approximate-counting
We might create a separate ticket to add the approximate count to the queryset API.
comment:5 by , 10 years ago
thanks claudep for the mysql link, codingjoe and me had the same idea about adding this to the db-backends and queryset, and then (optionally) using it for the paginator
comment:6 by , 9 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
will create a 3rd party library for this
setting triage to accepted after discussion with Russell Keith-Magee