On Tue, 2009-02-17 at 15:20 -0600, Jeremy Dunck wrote:
> On Tue, Feb 17, 2009 at 3:15 PM, Jeremy Dunck <[email protected]> wrote:
> ...
> > {% for question in poll.questions.all.iterator %}
> > works just fine.
> >
> 
> OK, last one from me.
> 
> As a 2.0 wish, I'd like to make .iterator the default behavior, and
> the cached-version a special case.  I realize this point is quite
> debatable.

I'd be somewhat against this, I think. It's *very* easy to reuse
querysets and inadvertently cause extra database queries. Unless you're
using really huge querysets, the memory usage is not going to kill you.
Pulling back the huge number of results already uses a bunch of memory
and that's a property of the db wrapper. There's a multiplier involved
for creating Python objects. Since we have a way to not use the caching
if somebody wants to optimise on that level and since doing that and
then doing a second database access is quite slow, we're trading memory
usage for speed and ease of use (and providing a way to improve the
former in "expert mode").

I really don't look forward to the five questions a day on django-users
about all the databae queries that are happening. I know you're only
talking about the mythical 2.0, but that doesn't change how people will
behave. I'm strongly in favour of keeping Django's primary audience as
experienced developers wanting to work faster, but we do have a large
non-experienced and even absolute beginner userbase, so simple things
that can save them a lot of time aren't to be dismissed out of hand.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to