boxtribute
boxtribute copied to clipboard
Use peewee iterator in loaders
cf. http://docs.peewee-orm.com/en/latest/peewee/querying.html#iterating-over-large-result-sets
To reduce the amount of memory used by peewee when iterating over a query, use the iterator() method. This method allows you to iterate without caching each model returned, using much less memory when iterating over large result sets.