PythonHub
2.49K subscribers
2.35K photos
49.7K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
Django Time-Based Lookups: A Performance Trap

The article shows how certain Django time-based field lookups can bypass database indexes and turn a simple filter into a full table scan, dramatically slowing queries. It then demonstrates a much faster pattern by computing time boundaries in Python so the database can use the existing index and drop execution time from tens of seconds to under a second.

https://johnnymetz.com/posts/django-time-based-lookups-performance/