[CentralOH] Places.objects.all() Seems to be An Iterator

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Mon Jun 4 18:53:41 CEST 2012


On Mon, 4 Jun 2012 11:44:01 -0400, Mr Mark E Erbaugh <mark at microenh.com> wrote:

> Does Places.objects.all() return an iterator or a sequence?

The dox that I've read[1] do not directly say, but suggest that 
.all() returns an iterator. See the Iteration and list() items 
in the list of ways that a QuerySet can be evaluated in the 
dox that I read. 

The memory usage has slowly increased as the program progressed. 
Last night, I noticed that it was a little over 10 GB and 
increasing. Considering how it had progressed, I expected 
it to use about 30 GB towards the end. Additionally, it 
currently seems stuck with memory usage stable at 18.6 GB and 
CPU usage around 1% (used to be high). 

[1] https://docs.djangoproject.com/en/1.4/ref/models/querysets/#when-querysets-are-evaluated

[2] this also does not explicitly state whether what .all() 
    returns (QuerySet) is an iterator or sequence. 
    https://docs.djangoproject.com/en/dev/ref/models/querysets/#all



More information about the CentralOH mailing list