On Saturday 25 February 2006 18:25, ChaosKCW wrote:
> A dumb question, but will objects.all() cause any kind
of performance
> hit ?
>
> I mean when the code appends
QuerySet.filter(pk=object_id), will it
> condense that to a SQL statement that returns one
object or reutrn
> all obejcts then do the PK query ?
It creates a new SQL statement that returns one objects,
without ever
having done the original query, so there is no performance
hit. To do
the PK query client side would mean you'd have to replicate
all the
features of the DB in Python.
Luke
--
Parenthetical remarks (however relevant) are unnecessary
Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-users googlegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribe googlegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---
|