Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#2662 closed enhancement (fixed)

[patch] dictfetchmany and dictfetchall should use generators

Reported by: Simon Willison Owned by: Adrian Holovaty
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: no UI/UX: no

Description

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.

Change History (2)

by Simon Willison, 19 years ago

Attachment: util.py.diff added

Patch changing dictfetchmany and dictfetchall to be generators

comment:1 by Malcolm Tredinnick, 19 years ago

Resolution: fixed
Status: newclosed

(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