Skip to main content

Commands and models for tracking internal postgres stats.

Project description

django-pgstats provides commands and models for tracking internal postgres stats. Specifically, the IndexStats model stores stats about postgres indices and the TableStats model stores stats about postgres tables.

Postgres stat tables contain global statistical information. django-pgstats is meant to be executed periodically so that one can later analyze table and index usage. This is done by periodically calling python snapshot_pgstats using a task runner such as [Celery](

Stats are stored as JSON fields in the respective IndexStats and TableStats models. Each key in the JSON field is in the format of {schema}.{table} for table stats or {schema}.{table}.{index} for index stats.


View the django-pgstats docs here.


Install django-pgstats with:

pip3 install django-pgstats

After this, add pgstats to the INSTALLED_APPS setting of your Django project.

Contributing Guide

For information on setting up django-pgstats for development and contributing changes, view CONTRIBUTING.rst.

Primary Authors

  • @wesleykendall (Wes Kendall)

  • @tomage (Tómas Árni Jónasson)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-pgstats-1.0.8.tar.gz (4.8 kB view hashes)

Uploaded source

Built Distribution

django_pgstats-1.0.8-py3-none-any.whl (5.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page