Re: [Django] #15020: Redundant joins generated when using reverse foreign key

2015-08-15 Thread Django
#15020: Redundant joins generated when using reverse foreign key
-+-
 Reporter:  adurdin  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 Seems to be fixed in Django 1.6.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.56f7ce0c923d63a2b43ac4141bea9adf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15020: Redundant joins generated when using reverse foreign key

2011-04-13 Thread Django
#15020: Redundant joins generated when using reverse foreign key
-+-
   Reporter:  adurdin|Owner:  nobody
   Type:  Bug|   Status:  new
  Milestone: |Component:  Database layer
Version:  SVN|  (models, ORM)
 Resolution: | Severity:  Normal
   Triage Stage:  Accepted   | Keywords:
Needs documentation:  0  |Has patch:  0
Patch needs improvement:  0  |  Needs tests:  0
-+-
Changes (by anonymous):

 * type:   => Bug
 * severity:   => Normal


-- 
Ticket URL: 
Django 
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.



Re: [Django] #15020: Redundant joins generated when using reverse foreign key

2011-02-16 Thread Django
#15020: Redundant joins generated when using reverse foreign key
+---
   Reporter:  adurdin   | Owner:  nobody
 Status:  new   | Milestone:
  Component:  Database layer (models, ORM)  |   Version:  SVN   
 Resolution:|  Keywords:
   Triage Stage:  Accepted  | Has patch:  0 
Needs documentation:  0 |   Needs tests:  0 
Patch needs improvement:  0 |  
+---
Changes (by russellm):

  * owner:  russellm => nobody
  * status:  assigned => new


Comment:

 Not sure how this got assigned to me

-- 
Ticket URL: 
Django 
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.



Re: [Django] #15020: Redundant joins generated when using reverse foreign key

2011-01-05 Thread Django
#15020: Redundant joins generated when using reverse foreign key
---+
  Reporter:  adurdin   | Owner:  russellm
Status:  assigned  | Milestone:  
 Component:  Database layer (models, ORM)  |   Version:  SVN 
Resolution:|  Keywords:  
 Stage:  Accepted  | Has_patch:  0   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Comment (by adurdin):

 To clarify: I found incorrect queries when I was using the two variations
 on this queryset, `...isnull=True`, and `...isnull=False`. I presumed that
 they were related, since it was only a parameter to the queryset that I
 was changing. I found #14056 when searching to see if this was a reported
 issue, and found that its description and patch matched and fixed only the
 second of the two incorrect queries. That could be coincidental; I wasn't
 able to follow the query generation well enough to know.

-- 
Ticket URL: 
Django 
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-upda...@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.



Re: [Django] #15020: Redundant joins generated when using reverse foreign key

2011-01-05 Thread Django
#15020: Redundant joins generated when using reverse foreign key
---+
  Reporter:  adurdin   | Owner:  russellm
Status:  assigned  | Milestone:  
 Component:  Database layer (models, ORM)  |   Version:  SVN 
Resolution:|  Keywords:  
 Stage:  Accepted  | Has_patch:  0   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * status:  new => assigned
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * owner:  nobody => russellm
  * needs_docs:  => 0
  * stage:  Unreviewed => Accepted

Comment:

 I'm not sure I see the connection with #14056, but this certainly appears
 to be a problem. I'm going to guess that it's the primary_key=True on a
 ForeignKey that is causing the confusion.

-- 
Ticket URL: 
Django 
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-upda...@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.



[Django] #15020: Redundant joins generated when using reverse foreign key

2011-01-05 Thread Django
#15020: Redundant joins generated when using reverse foreign key
--+-
 Reporter:  adurdin   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  SVN   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 A query using a reverse foreign key generates a left outer join to a
 related table and a second, redundant left outer join to the original
 table.

 Tested in Django 1.1 and trunk r15147, and found to be an issue in both.

 '''Using these models:'''
 {{{
 from django.db import models

 class Original(models.Model):
 pass # Don't need anything more for this test

 class Reference(models.Model):
 original = models.ForeignKey(Original, primary_key=True)
 }}}

 Background: the `Reference` model is used for storing and testing set
 membership; an `Original` instance is a member of the set iff its PK is in
 the `Reference` table.


 '''Incorrect query was generated for this queryset:'''
 {{{
 Original.objects.filter(reference__pk__isnull=True)
 }}}

 Generated SQL:
 {{{
 SELECT `fkpk_original`.`id` FROM `fkpk_original`
 LEFT OUTER JOIN `fkpk_reference` ON (`fkpk_original`.`id` =
 `fkpk_reference`.`original_id`)
 LEFT OUTER JOIN `fkpk_original` T3 ON (`fkpk_reference`.`original_id` =
 T3.`id`)
 WHERE T3.`id` IS NULL
 }}}

 Expected SQL:
 {{{
 SELECT `fkpk_original`.`id` FROM `fkpk_original`
 LEFT OUTER JOIN `fkpk_reference` ON (`fkpk_original`.`id` =
 `fkpk_reference`.`original_id`)
 WHERE `fkpk_reference`.`original_id` IS NULL
 }}}


 '''Notes'''

 An incorrect query is also generated for the following queryset; however
 this seems to be covered by #14056:
 {{{
 Original.objects.filter(reference__pk__isnull=False)
 }}}

-- 
Ticket URL: 
Django 
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-upda...@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.