#15361: Document performance considerations when using Queryset.get()
-----------------------------------------+-------------------------
Reporter: mbertheau | Owner: mmcnickle
Status: new | Milestone: 1.3
Component: Documentation | Version: 1.2
Resolution: | Keywords:
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 1 |
-----------------------------------------+-------------------------
Changes (by gabrielhurley):
* needs_better_patch: 0 => 1
Comment:
The patch looks mostly good.
However, the last chunk in the optimization addition isn't quite right.
While I understand how that query can potentially be slow, in the sample
code that the slowness is trivialized by the fact that it's going to raise
`MultipleObjectsReturned` and (in the context of the example) result in an
uncaught exception.
So, while the advice on unique, indexed columns is solid, I'd like to see
the contrasting slowness illustrated in a way that would work in a real-
world use case. Additionally, a little more explanation of *why* that
query could be slow would add a lot for new users.
--
Ticket URL: <http://code.djangoproject.com/ticket/15361#comment:11>
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.