#15361: QuerySet.get() should use LIMIT 2
--------------------------------------------------------+-------------------
 Reporter:  mbertheau                                   |          Owner:  
nobody    
   Status:  new                                         |      Milestone:       
     
Component:  Database layer (models, ORM)                |        Version:  1.2  
     
 Keywords:  QuerySet get limit MultipleObjectsReturned  |   Triage Stage:  
Unreviewed
Has patch:  0                                           |  
--------------------------------------------------------+-------------------
 Currently QuerySet.get() counts the number of rows in the result set. For
 get()'s semantics though, what's important is only whether there were 0, 1
 or more rows returned. Counting the whole number of rows is a potentially
 expensive operation compared to stopping after the first 2 rows. Therefore
 QuerySet.get() should use LIMIT 2 (and no ORDER BY)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15361>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to