# Django Admin Range-Based Date Hierarchy

DevFeed: [Django Admin Range-Based Date Hierarchy](<https://devfeed.tech/articles/django-admin-range-based-date-hierarchy-33893.md>)

Original publisher: [Read original article](<https://hakibenita.com/django-admin-range-based-date-hierarchy>)

Author: Haki Benita

Published: 2017-12-10T22:00:00Z

Content type: article

Language: en

Sources: [Haki Benita](<https://devfeed.tech/sources/haki-benita.md>)

Topics: [Django](<https://devfeed.tech/topics/django.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [optimize](<https://devfeed.tech/topics/optimize.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [articles](<https://devfeed.tech/tags/articles.md>), [django](<https://devfeed.tech/tags/django.md>), [django-admin](<https://devfeed.tech/tags/django-admin.md>), [index](<https://devfeed.tech/tags/index.md>), [optimize](<https://devfeed.tech/tags/optimize.md>), [performance](<https://devfeed.tech/tags/performance.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [query](<https://devfeed.tech/tags/query.md>), [regression](<https://devfeed.tech/tags/regression.md>), [timeout](<https://devfeed.tech/tags/timeout.md>)

## AI overview

The article investigates a performance regression in a Django Admin transactions list view caused by date hierarchy filtering. It explains that applying database functions to date fields can prevent PostgreSQL from using a range-based index effectively, leading to poor execution plans and slow loading.

## Source excerpt

A few weeks ago we encountered a major performance regression in one of our main admin pages. The page took more than 10 seconds to load (at best) and hit the query execution timeout at worst. When we investigated the issue, we found that the date hierarchy was the cause for most of the time spent loading the admin page. In the article we describe how we significantly improved the performance of Django Admin date hierarchy