Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2662 closed enhancement (fixed)

[patch] dictfetchmany and dictfetchall should use generators

Reported by: Simon Willison Owned by: adrian
Component: Database layer (models, ORM) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


In db.backends.util, dictfetchmany and dictfetchall currently use list comprehensions and will cause all rows to be loaded in to memory. Those functions should be generators, allowing rows to be loaded one at a time.

Attachments (1) (751 bytes) - added by Simon Willison 9 years ago.
Patch changing dictfetchmany and dictfetchall to be generators

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by Simon Willison

Patch changing dictfetchmany and dictfetchall to be generators

comment:1 Changed 9 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [3783]) Fixed #2662 -- Changed dictfetchmany and dictfetchall to return iterators,
rather than a list, in order to save memory. Patch from Simon Willison.

Note: See TracTickets for help on using tickets.
Back to Top