Awesome

Right now im looping through the items as follows


        chunk_size = 10000
        start = 0
        while True:
            end = start + chunk_size
            items= items_queryset[start:end]; start += chunk_size


etc.

Is there an option to specify the chunk size (actual value retrieval,
not just object creation)?
Cause from the docs it appears to read all data in memory and iterate
the objects...
http://docs.djangoproject.com/en/dev/ref/models/querysets/#iterator








On Sep 6, 4:17 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Sun, Sep 6, 2009 at 10:14 AM, Thierry<thierryschellenb...@gmail.com> wrote:
>
> > QuerySet cache is usually quite great.
> > However when you are looping through a very large result set it would
> > be great if I could turn it off.
> > So here the question, how do I turn off the queryset cache?
>
> Just call .iterator() on the QuerySet and it will hvae it's cache disabled.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your
> right to say it." -- Voltaire
> "The people's good is the highest law." -- Cicero
> "Code can always be simpler than you think, but never as simple as you
> want" -- Me
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to