Hello,
I've thought, that QuerySets whose are iterated does not allocate memory 
for all objects. But simple test shows otherwise. When I iterate through
SomeModel.objects.all() I get same memory consumption like with 
list(SomeModel.objects.all()). It is very frustrating, because with test 
database (which is definitely not as large as production one) with 
approximately 30000 records I get about two GB of memory per process. 
Iterating through all records in my app is a special case, but needed one.

So my question is: Is (or should be) there a difference between 
iterating and enumerating objects? Is there any way to load object on 
demand only, so to use memory only roughly equal to sizeof(SomeModel)?

-- 

                        Tomas Kopecek
                        e-mail: permonik at mesias.brnonet.cz
                         ICQ: 114483784

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to