Re: [Django] #13017: generic relation generates needless join

2013-08-19 Thread Django
#13017: generic relation generates needless join
-+-
 Reporter:  MS   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:  needsinfo
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  database joins   |  Needs documentation:  0
  generic relation   |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  1|
Easy pickings:  0|
-+-
Changes (by akaariai):

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


Comment:

 I am closing this as needsinfo. The query
 `GenericTest.objects.filter(reftest__testdata=0)` isn't valid Django
 query.

-- 
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/060.25d688f582c594a15b58812bd4b3ae5a%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #13017: generic relation generates needless join

2011-04-15 Thread Django
#13017: generic relation generates needless join
-+-
   Reporter:  MS |Owner:  nobody
   Type:  Bug|   Status:  new
  Milestone:  1.3|Component:  Database layer
Version:  SVN|  (models, ORM)
 Resolution: | Severity:  Normal
   Triage Stage:  Accepted   | Keywords:  database joins
Needs documentation:  0  |  generic relation
Patch needs improvement:  0  |Has patch:  1
 |  Needs tests:  1
-+-
Changes (by julien):

 * type:  Cleanup/optimization => Bug
 * needs_tests:  0 => 1


-- 
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] #13017: generic relation generates needless join

2011-04-13 Thread Django
#13017: generic relation generates needless join
-+-
   Reporter:  MS |Owner:  nobody
   Type: |   Status:  new
  Cleanup/optimization   |Component:  Database layer
  Milestone:  1.3|  (models, ORM)
Version:  SVN| Severity:  Normal
 Resolution: | Keywords:  database joins
   Triage Stage:  Accepted   |  generic relation
Needs documentation:  0  |Has patch:  1
Patch needs improvement:  0  |  Needs tests:  0
-+-
Changes (by blacklwhite):

 * stage:  Ready for checkin => Accepted


-- 
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] #13017: generic relation generates needless join

2011-04-13 Thread Django
#13017: generic relation generates needless join
-+-
   Reporter:  MS |Owner:  nobody
   Type: |   Status:  new
  Cleanup/optimization   |Component:  Database layer
  Milestone:  1.3|  (models, ORM)
Version:  SVN| Severity:  Normal
 Resolution: | Keywords:  database joins
   Triage Stage:  Ready for  |  generic relation
  checkin|Has patch:  1
Needs documentation:  0  |  Needs tests:  0
Patch needs improvement:  0  |
-+-
Changes (by blacklwhite):

 * stage:  Accepted => Ready for checkin


-- 
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] #13017: generic relation generates needless join

2010-03-16 Thread Django
#13017: generic relation generates needless join
---+
  Reporter:  MS| Owner:  nobody 

Status:  new   | Milestone:  1.3

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  database 
joins generic relation
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Comment (by MS):

 There was another mistake in the patch, using the wrong database field
 with generic relations.

 I am sad, that this patch won't be in 1.2, because it saves us a lot of
 time and ram used the database. Without it we would need a bigger server
 for database requests.

-- 
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] #13017: generic relation generates needless join

2010-03-10 Thread Django
#13017: generic relation generates needless join
---+
  Reporter:  MS| Owner:  nobody 

Status:  new   | Milestone:  1.3

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  database 
joins generic relation
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * milestone:  1.2 => 1.3

Comment:

 Not critical for 1.2

-- 
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] #13017: generic relation generates needless join

2010-03-08 Thread Django
#13017: generic relation generates needless join
---+
  Reporter:  MS| Owner:  nobody 

Status:  new   | Milestone:  1.2

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  database 
joins generic relation
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Comment (by MS):

 The new patch has removed the double line, which was not nessecary in the
 patch before.

-- 
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] #13017: generic relation generates needless join

2010-03-05 Thread Django
#13017: generic relation generates needless join
---+
  Reporter:  MS| Owner:  nobody 

Status:  new   | Milestone:  1.2

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  database 
joins generic relation
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Comment (by MS):

 This bug is also in Django 1.1 so i think it's not a regression.

-- 
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] #13017: generic relation generates needless join

2010-03-04 Thread Django
#13017: generic relation generates needless join
---+
  Reporter:  MS| Owner:  nobody 

Status:  new   | Milestone:  1.2

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  database 
joins generic relation
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * needs_better_patch:  => 0
  * needs_docs:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * milestone:  => 1.2

Comment:

 This is possibly a regression caused by the recent m2m changes; needs
 further investigation.

-- 
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] #13017: generic relation generates needless join

2010-03-03 Thread Django
#13017: generic relation generates needless join
-+--
 Reporter:  MS   |   Owner:  nobody
   Status:  new  |   Milestone:
Component:  Database layer (models, ORM) | Version:  SVN   
 Keywords:  database joins generic relation  |   Stage:  Unreviewed
Has_patch:  1|  
-+--
 I have an generic relation, and tries to do some database queries with
 this relation.
 When looking at the generated sql query i saw, that double joins are
 created. This happens
 because generic relations are based on m2m table with a missing database
 table.

 An example for the model:
 {{{
 from django.db import models
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes import generic

 class GenericTest(models.Model):
 contentType = models.ForeignKey(ContentType)
 objectId = models.PositiveIntegerField()
 contentObject = generic.GenericForeignKey('contentType', 'objectId')

 class RefTest(models.Model):
 generic = generic.GenericRelation(GenericTest,
 content_type_field='contentType', object_id_field='objectId')
 testdata = models.PositiveIntegerField()
 }}}
 the query:

 {{{GenericTest.objects.filter(reftest__testdata=0)}}}

 as sql:

 {{{('SELECT U0.`id` FROM `test_generictest` U0 INNER JOIN
 `test_generictest` U1 ON (U0.`id` = U1.`id`) INNER JOIN `test_reftest` U2
 ON (U1.`objectId` = U2.`id`) WHERE U2.`testdata` = %s ', (0,))}}}

 With the applied patch, which made the same test, which is done in the
 direct case, the sql query looks like:

 {{{('SELECT U0.`id` FROM `test_generictest` U0 INNER JOIN `test_reftest`
 U1 ON (U0.`id` = U1.`id`) WHERE U1.`testdata` = %s ', (0,))}}}

 For simple databases and simple sql queries, this extra join is no
 problem, but with complex ones, its a huge performance lack.

-- 
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.