#23372: Prevent loaddata from disabling and enabling constraints when no 
fixtures
are found
-------------------------------------+-------------------------------------
     Reporter:  manfre               |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Testing framework    |                  Version:  1.7
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

 In [changeset:"99569b22d93737f6304ffe808ebf1d0d711fedd9" 99569b22]:
 {{{
 #!CommitTicketReference repository=""
 revision="99569b22d93737f6304ffe808ebf1d0d711fedd9"
 [1.9.x] Fixed #23372 -- Made loaddata faster if it doesn't find any
 fixtures.

 Django's test suite often tries to load fixture files from apps that have
 no fixtures at all. This creates a lot of unnecessary disabling and
 enabling of constraints which can be expensive on some database.

 To speed this up, loaddata now first checks if any fixture file matches.
 If no fixture file is matched, then the command exits before disabling
 and enabling of constraints is done.

 The main benefit of this change is seen on MSSQL, where tests on
 Django 1.8 run hours faster.

 Backport of ee9f4686b19e2b4a68f5cb4f9d61dc045c1d4c63 from master
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23372#comment:19>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.1bb273f673907ec7edf379dc2c1ece36%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to