Django慢查询

时间:2018-06-08 15:21:50

标签: django performance django-queryset

此查询非常慢,在我们升级Django 1.8.7 =>之后无法运行1.11.13

  q = WorkReport.objects.filter(
        ~Q(case__customer=session.integration.null_customer),
        ~Q(product = None) | ~Q(work_type__bill_as_product = None),
        ~Q(case = None),
        ~Q(case__casesync__is_closed = True),
        employee__company=session.integration.company, 
        productreportonquotationsync=None,
        productreportonordersync=None,productreportsync=None,
        productreportoncaseasinvoicesync = None,
        approved=True)

0 个答案:

没有答案