Changes between Version 6 and Version 7 of Ticket #25470
- Timestamp:
- Sep 27, 2015, 9:53:20 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #25470
- Property Summary Django cast DATE field to DATETIME unexpectedly → Serious performance impact (500x slower!) when querying distinct model dates objects
-
Ticket #25470 – Description
v6 v7 19 19 As you can see, the query did possibly an unnecessary type cast. The performance impact is scaled to the amount of records. The table field is exactly `DATE` type. I don't know, if there is some reason for the type casting. 20 20 21 Currently, I use a workaround:21 Currently, I use another query to get these dates, which takes 0.04 second. 22 22 {{{ 23 23 db_dates = Model1.objects.values_list('date', flat=True).distinct()