Re: [Django] #15957: ModelChoiceField slow performance

2011-05-03 Thread Django
#15957: ModelChoiceField slow performance
+
   Reporter:  uriel.bertoche@…  |  Owner:  nobody
   Type:  Cleanup/optimization  | Status:  closed
  Milestone:|  Component:  Forms
Version:  1.3   |   Severity:  Normal
 Resolution:  wontfix   |   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
+

Comment (by aaugustin):

 
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_select_related
 says the admin is already preloading related models:
 {{{
 Note that Django will use select_related(), regardless of this setting if
 one of the list_display fields is a ForeignKey.
 }}}

 If this is not true, then it's a bug in Django; could you provide a test
 case showing the problem?

-- 
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] #15957: ModelChoiceField slow performance

2011-05-03 Thread Django
#15957: ModelChoiceField slow performance
+
   Reporter:  uriel.bertoche@…  |  Owner:  nobody
   Type:  Cleanup/optimization  | Status:  closed
  Milestone:|  Component:  Forms
Version:  1.3   |   Severity:  Normal
 Resolution:  wontfix   |   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
+

Comment (by anonymous):

 changing the SQL query it makes would improve it. instead of getting all
 entries and then fetching their __unicode__ one by one, you could get all
 entries and fetch all of them in one single SQL.

-- 
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] #15957: ModelChoiceField slow performance

2011-05-03 Thread Django
#15957: ModelChoiceField slow performance
+
   Reporter:  uriel.bertoche@…  |  Owner:  nobody
   Type:  Cleanup/optimization  | Status:  closed
  Milestone:|  Component:  Forms
Version:  1.3   |   Severity:  Normal
 Resolution:  wontfix   |   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
+
Changes (by aaugustin):

 * status:  new => closed
 * needs_better_patch:   => 0
 * resolution:   => wontfix
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 By definition, a !ModelChoiceField is going to include all elements in the
 queryset. I don't see how Django could do this faster than O(n). You
 shouldn't use !ModelChoiceField for more than 1000 entries. Anyway, it
 becomes very quickly unusable beyond 100 entries.

 See the documentation here:
 
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.raw_id_fields

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