#26400: QuerySet bulk_create method to handle generators to prevent loading all
objects in memory at once
----------------------------------------------+-------------------------
Reporter: likeon | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Database layer (models, ORM) | Version: master
Severity: Normal | Keywords: bulk_create
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+-------------------------
In my case I need to create huge amount of objects using bulk create
method with batch_size parameter.
The problem is I don't have enough memory to store all objects in a list.
Even if I transmit generator it would be converted to list anyway
(https://github.com/django/django/blob/1.9.4/django/db/models/query.py#L438).
I want to implement a feature to handle generators properly without
loading all objects in memory, but bulk_create method returns list of
objects as a result. That is unacceptable on large amounts of data.
How can I properly implement the method: create a new one or add a
parameter to actual method?
--
Ticket URL: <https://code.djangoproject.com/ticket/26400>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.1294b9f011ab355ec9084d6290da4658%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.