﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
5987	__iter__ on a QuerySet doesn't return an efficient iterator	kenneth.arnold@…	nobody	"For a loop such as:


{{{
for item in Model.objects.all():
  print item # or whatever
}}}


the first line eats up all system memory for sufficiently large Models.

Replacing it with Model.objects.all().iterator() improves the situation a lot. Why doesn't __iter__ return iterator()?

(I see that __iter__ can use a cache. Is there a reason not to compute the cache on-the-fly?)
"		closed	Database layer (models, ORM)	dev		fixed	iterator __iter__ qs-rf-fixed		Accepted	0	0	0	0	0	0
