Re: Multiprocess Queryset memory consumption increase (DEBUG=False and using iterator)

2012-05-29 Thread Pieter Claassen
Anssi, Thanks for your trouble, you were right, the problem was in my other code. Regards, P Are you sure the leak is not in process_messages? > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: Multiprocess Queryset memory consumption increase (DEBUG=False and using iterator)

2012-05-28 Thread akaariai
On May 28, 5:42 pm, pc wrote: > I am stumped. I am trying process a lot of data (2 million records and > up) and once I have a QuerySet, I immediately feed it to a > queryset_iterator that fetched results in chunks of 1000 rows each. I > use MySQL and the DB server is on another machine (so I don'

Multiprocess Queryset memory consumption increase (DEBUG=False and using iterator)

2012-05-28 Thread pc
I am stumped. I am trying process a lot of data (2 million records and up) and once I have a QuerySet, I immediately feed it to a queryset_iterator that fetched results in chunks of 1000 rows each. I use MySQL and the DB server is on another machine (so I don't think it is MySQL caching). I kick o

Re: QuerySet & memory

2007-08-28 Thread Jeremy Dunck
On 8/28/07, Tomas Kopecek <[EMAIL PROTECTED]> wrote: ... > For me it could be more appropriate to change iterator() to do some > slicing for me (by explicit LIMIT clause), maybe a small patch for our > application. I understand, that changing it in general would be a bad > design decision. Ick.

Re: QuerySet & memory

2007-08-28 Thread Tomas Kopecek
James Bennett napsal(a): > On 8/27/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: >> QuerySet.iterator does what you want. > > I was going to follow up with a documentation link, but it appears we > lost the documentation for QuerySet.iterator at some point. Opened a > ticket > > In any case, Jerem

Re: QuerySet & memory

2007-08-27 Thread James Bennett
On 8/27/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > QuerySet.iterator does what you want. I was going to follow up with a documentation link, but it appears we lost the documentation for QuerySet.iterator at some point. Opened a ticket In any case, Jeremy's right: the "iterator" method returns

Re: QuerySet & memory

2007-08-27 Thread Jeremy Dunck
On 8/27/07, Tomas Kopecek <[EMAIL PROTECTED]> wrote: > I've thought, that QuerySets whose are iterated does not allocate memory > for all objects. QuerySet.iterator does what you want. QuerySet.__iter__ (the python method that is called from the for loop) returns an iterator over the results of

Re: QuerySet & memory

2007-08-27 Thread Doug B
There isn't much difference. Once you ennumerate,slice, or iterate a queryset that's when the actual database query occurs. It will pull in all matching object in order to save you additional queries. Why not iterate in batches, by slicing the query? That way if you set you step to say 100, yo

QuerySet & memory

2007-08-27 Thread Tomas Kopecek
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 datab