#36497: Add ModelAdmin.estimated_count for faster changelist pagination
-------------------------------------+-------------------------------------
     Reporter:  rylaix               |                     Type:  New
                                     |  feature
       Status:  new                  |                Component:
                                     |  contrib.admin
      Version:  5.2                  |                 Severity:  Normal
     Keywords:  performance          |             Triage Stage:
  pagination                         |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 This ticket proposes adding support for an `estimated_count = True` flag
 on ModelAdmin to improve pagination performance on large datasets.

 When enabled, the Django admin will use an estimated row count instead of
 executing a full COUNT(*) in changelist views. This estimation is based
 on:

 - PostgreSQL: pg_class.reltuples
 - MySQL: SHOW TABLE STATUS

 The patch includes:

 - `estimate_row_count()` helper function
 - Support in `ChangeList.get_results()`
 - Unit tests for fallback and estimation behavior
 - Integration test for PostgreSQL
 - Benchmark script
 - Documentation of the new ModelAdmin.estimated_count attribute

 If estimation fails or is unsupported, it gracefully falls back to the
 standard `queryset.count()`.

 A full patch is already available and a PR will be submitted shortly.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36497>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070197e466c0c4-232e3f40-b8da-46cd-9e0b-5c397e4881b2-000000%40eu-central-1.amazonses.com.

Reply via email to