#7512: including a nullable foreign key reference in Meta ordering has 
unexpected
results
----------------------------------------------------+-----------------------
          Reporter:  R. Bailey <[EMAIL PROTECTED]>  |         Owner:  gav       
 
            Status:  new                            |     Milestone:  1.0       
 
         Component:  Database wrapper               |       Version:  SVN       
 
        Resolution:                                 |      Keywords:  
1.0-blocker
             Stage:  Accepted                       |     Has_patch:  1         
 
        Needs_docs:  0                              |   Needs_tests:  0         
 
Needs_better_patch:  1                              |  
----------------------------------------------------+-----------------------
Comment (by mtredinnick):

 The fact that one of the tests in `regressiontests/queries/models.py` that
 was testing for the absence of outer joins had to be changed to show that
 there was a (completely unnecessary) outer join shows that this patch is
 doing something wrong. It's not that test that is wrong; it's the
 resulting query that is now wrong. We should ''never'' do outer joins
 unless they are required. They are much more expensive at the database
 side.

 Unconditionally promoting joins just because the foreign key can be
 nullable is therefore not the way to do this, because you don't need an
 outer join unless you care about null values  -- not the case when
 comparing across a nullable join to a non-null value.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7512#comment:9>
Django Code <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to