#11320: Over aggressive join promotion with exclude() ------------------------------------------+--------------------------------- Reporter: Alex | Owner: nobody Status: new | Milestone: Component: Database layer (models, ORM) | Version: SVN Keywords: | Stage: Unreviewed Has_patch: 0 | ------------------------------------------+--------------------------------- Currently filter() optimizes it so that when you create a query such that a relation must exist it uses an INNER JOIN, since that's faster than an OUTER JOIN. However with exclude() a query such as:
{{{ #!python class MyModel(models.Model): venue = models.ForeignKey("Venue", null=True) MyModel.objects.exclude(venue=None).exclude(venue__name='a') }}} For this query it should be using an INNER JOIN but instead uses a LEFT OUTER JOIN. -- Ticket URL: <http://code.djangoproject.com/ticket/11320> Django <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 django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---