Django: Why is Foo.objects.extra(…) So Much Faster Than Foo.objects.raw?
问题 So I am trying to optimize a fairly odd query, but this is a legacy database so I make do with what I have. These are the queries I am trying. They provide the same output at this point. w is my queryset. def future_schedule(request): past = datetime.date.today()-datetime.timedelta(days=730) extra_select = { 'addlcomplete': 'SELECT Complete FROM tblAdditionalDates WHERE Checkin.ShortSampleID = tblAdditionalDates.ShortSampleID', 'addldate': 'SELECT AddlDate FROM tblAdditionalDates WHERE