Aller au contenu

Large Result Not Chunked (ARCH2062)

Ce contenu n’est pas encore disponible dans votre langue.

Key python.orm.large-result-not-chunked · Severity info · Category orm

Loading an entire large result set into memory then iterating misses the chance to avoid loading millions of rows when a streaming/chunked cursor API exists.

for row in list(Event.objects.all()): # all loaded into memory
process(row)
for row in Event.objects.all().iterator(chunk_size=1000): # chunked stream
process(row)

Process large results in chunks via a streaming API such as iterator(chunk_size=...).