Changes between Version 6 and Version 7 of Ticket #25470


Ignore:
Timestamp:
Sep 27, 2015, 9:53:20 PM (9 years ago)
Author:
Qian Xu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25470

    • Property Summary Django cast DATE field to DATETIME unexpectedlySerious performance impact (500x slower!) when querying distinct model dates objects
  • Ticket #25470 – Description

    v6 v7  
    1919As 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.
    2020
    21 Currently, I use a workaround:
     21Currently, I use another query to get these dates, which takes 0.04 second.
    2222{{{
    2323db_dates = Model1.objects.values_list('date', flat=True).distinct()
Back to Top