Large Result Not Chunked (ARCH2062)
هذا المحتوى غير متوفر بلغتك بعد.
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.
Incorrect
Section titled “Incorrect”for row in list(Event.objects.all()): # all loaded into memory process(row)Correct
Section titled “Correct”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=...).