Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 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:

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.

Attachments (1)

util.py.diff (751 bytes) - added by Simon Willison 8 years ago.
Patch changing dictfetchmany and dictfetchall to be generators

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by Simon Willison

Patch changing dictfetchmany and dictfetchall to be generators

comment:1 Changed 8 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.