#15361: QuerySet.get() should use LIMIT 2
--------------------------------------------------------+-------------------
               Reporter:  mbertheau                     |         Owner:  
nobody                                    
                 Status:  new                           |     Milestone:        
                                    
              Component:  Database layer (models, ORM)  |       Version:  1.2   
                                    
             Resolution:                                |      Keywords:  
QuerySet get limit MultipleObjectsReturned
           Triage Stage:  Accepted                      |     Has patch:  1     
                                    
    Needs documentation:  0                             |   Needs tests:  0     
                                    
Patch needs improvement:  0                             |  
--------------------------------------------------------+-------------------

Comment (by Alex):

 I'm not sure it does, the majority of `get()` calls (in my experience) are
 on fields such as `pk` or `slug`, which have database level uniqueness
 constraints, and thus the database has no need to be told that there is a
 limit on the number of results.  Indeed the only case where this should
 make a large difference is if you're doing a `get()` from which the
 database will return a large number of results and then become a
 `MultipleObjectsReturned` exception, a case which I contend is unlikely.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15361#comment:5>
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