Approximate Counting in Django and Postgres
Briefly

Django's paginator, which relies on the slow SELECT COUNT(*) query to calculate the number of rows in a table, may result in over 95% of page loading time.
Two approaches to reducing loading time discussed are approximating row count using Postgres row estimation and extending Django's paginator to show only previous and next pages.
The article assumes exact count is insignificant when dealing with a large number of objects, focusing on faster loading times instead.
Read at Testdriven
[
add
]
[
|
|
]