On Thu, Feb 25, 2016 at 10:10 AM, Matthew Crowson <
matthew.d.crow...@gmail.com> wrote:

When Django creates the SQL to get an object from model.objects.get() it
> doesn't look like SQL is adding a "LIMIT 1" to the end. As the get method
> is always intended to return a single item, would adding that to Django's
> SQL speed things up?
>

This would hide errors in cases where there are more than one. Currently
you will get an exception raised if you try a get() and more than a single
result is returned, if a LIMIT 1 were added to the sql then this error
situation would be hidden from developers.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACS9radt_cXGF5Q5XFYegX8TinKKexb_o0FJ6SSTow%3DxHJpnog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to