#23319: Django uses unnecessary join in concrete inheritance
-------------------------------------+-------------------------------------
     Reporter:  avidi                |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Database layer       |                  Version:
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by timgraham):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 First and third cases might be valid, but if there's a possibility you
 could end up with a `Child` that doesn't have a `Parent`, then the join is
 necessary to filter out those objects and changing this would be backwards
 incompatible.

 Second case doesn't seem like a bug as `EmptyParent` isn't really empty
 (it has the auto-generated `id` field).

 The suggestion of "Maybe these could be solved using _ptr_id as "default
 pk"" is definitely backwards incompatible and would be unexpected behavior
 IMO. I'll leave this open so that someone with more knowledge of the ORM
 can point out if/why these joins are necessary (or accept the ticket if
 they aren't).

--
Ticket URL: <https://code.djangoproject.com/ticket/23319#comment:1>
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/063.134403fe5206941149e8b1e24a53b3b8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to