mysociety/mapit — pull request #43 by jennyd (2012-10-11 11:12:20+00:00)
Title: Use .iterator() to reduce memory usage in data migration

With all the UK data imported, this migration failed with a memory
error on a machine with 8GB of virtual memory, but it succeeded
when using .iterator() on the QuerySet. This is suggested in the
documentation for iterator, which says:

'For a QuerySet which returns a large number of objects,
[iterator()] often results in better performance and a
significant reduction in memory'

https://docs.djangoproject.com/en/1.2/ref/models/querysets/#iterator